Skip to content

Instantly share code, notes, and snippets.

// AI Cortex
// name : Count by X
// link : https://www.codewars.com/kata/5513795bd3fafb56c200049e
#include <vector>
std::vector<int> countBy(int x,int n){
std::vector<int> v;
for(int i=1; i<=n; i++)
v.push_back(i*x);
@pickletoni
pickletoni / countryPhoneCodes.json
Last active December 4, 2024 17:38 — forked from AdonaiAraya/countryPhoneCodes.json
JSON array of 248 countries with phone codes and ISO country code
[{"country":"Afghanistan","code":"93","iso":"AF"},
{"country":"Albania","code":"355","iso":"AL"},
{"country":"Algeria","code":"213","iso":"DZ"},
{"country":"American Samoa","code":"1-684","iso":"AS"},
{"country":"Andorra","code":"376","iso":"AD"},
{"country":"Angola","code":"244","iso":"AO"},
{"country":"Anguilla","code":"1-264","iso":"AI"},
{"country":"Antarctica","code":"672","iso":"AQ"},
{"country":"Antigua and Barbuda","code":"1-268","iso":"AG"},
{"country":"Argentina","code":"54","iso":"AR"},
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mediaupstream
mediaupstream / make_certs.sh
Last active December 4, 2024 17:30
extract ca-certs, key, and crt from a pfx file
#!/bin/bash
#
# Usage:
# ./make_certs.sh test.example.com
#
# The required input to make_certs.sh is the path to your pfx file without the .pfx prefix
#
# test.example.com.key
# test.example.com.crt (includes ca-certs)
@harperreed
harperreed / peter-thiels-cs183-startup-class-01-notes-essay.md
Created July 29, 2012 21:20
Notes Essays—Peter Thiel’s CS183: Startup—Stanford, Spring 2012

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble

@LeftistTachyon
LeftistTachyon / fun.js
Last active December 4, 2024 17:28
The scripting half of the pfp insanity
savestring = "*insert Base64 junk here*";
saving=true;
document.getElementById('button_save').style.background='#888';
statusdiv.innerHTML='Saving the painting';
(SaveObj=new XMLHttpRequest()).open('POST', 'includes/ajax_dsipaint_save.php', true);
SaveObj.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
SaveObj.send ('data='+savestring);
SaveObj.onreadystatechange=function(){
if(SaveObj.readyState==4){
@ayodejiayodele
ayodejiayodele / copilot-metrics-dashboard-instructions.md
Last active December 4, 2024 17:26
Setup Instructions for GitHub Copilot Metrics Power BI Dashboard

Copilot Metrics Dashboard (Power BI Version)

This guide provides step-by-step instructions for deploying the Copilot Metrics Dashboard in your environment.

Setup Instructions

To use this report, ensure you have Power BI Desktop installed or access to the Power BI online service.

This report supports Copilot Business and Copilot Enterprise products, utilizing the GitHub Copilot User Management and Metrics APIs. The Copilot Metrics API became generally available on October 30th, 2024. For more information, read here.

@LeviSnoot
LeviSnoot / discord-timestamps.md
Last active December 4, 2024 17:26
Discord Timestamp Syntax

Discord Timestamps

Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.

The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of 1543392060, which represents November 28th, 2018 at 09:01:00 hours for my local time zone (GMT+0100 Central European Standard Time).

Formatting

Style Input Output (12-hour clock) Output (24-hour clock)
Default <t:1543392060> November 28, 2018 9:01 AM 28 November 2018 09:01
@bittercoder
bittercoder / convert.sh
Last active December 4, 2024 17:25
Convert .heic files to .jpg on linux (coming from an iOS11 device over USB)
# download release from github: https://github.com/monostream/tifig/releases and install at ~/tools/tifig
# then run these commands in the folder (just to keep things simple we normalize the file extension case before proceeding).
for f in *.HEIC; do mv "$f" "`echo $f | sed s/.HEIC/.heic/`"; done
for file in *.heic; do echo "~/tools/tifig -v -p $file ${file/%.heic/.jpg}"; done
@plmcgrn
plmcgrn / Apple_Music_Up_Downvote_Shortcuts.md
Last active December 4, 2024 17:19
Setting favorite/suggest less keyboard shortcuts in Apple Music for Mac

Setting favorite/suggest less keyboard shortcuts in Apple Music for Mac

Apple seems to have dropped the ball on binding these fairly important actions to native shortcut keys while also supplying them for a mountain of things most people don't carte about. This gist will show you how to correct that.

Tested on Apple Music 1.4.2.83 on MacOS Sonoma 14.2.1

What you'll need

  • Automator
  • System Settings

Suggest Less and Next Track