Skip to content

Instantly share code, notes, and snippets.

View boolfalse's full-sized avatar
🕸️
Semper Paratus

San B boolfalse

🕸️
Semper Paratus
View GitHub Profile
@adhipg
adhipg / countries.sql
Created January 12, 2012 11:41
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@fiskus
fiskus / 1001-albums-you-must-hear-before-you-die.csv
Created November 11, 2012 15:25
1001 Albums You Must Hear Before You Die
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
year|album|artist
1955|In The Wee Small Hours|Frank Sinatra
1956|Ellington at Newport _56|Duke Ellington
1956|Elvis Presley|Elvis Presley
1956|Songs For Swingin' Lovers|Frank Sinatra
1956|Birth of the Cool|Miles Davis
1956|Tragic Songs Of Life|The Louvin Brothers
1957|The Atomic Mr Basie|Count Basie
1957|This is Fats Domino|Fats Domino
1957|Here_s Little Richard|Little Richard
@jiromm
jiromm / gist:5387374
Last active April 15, 2022 00:51
Get Rates from CBA bank of Armenia
<?php
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('soap.wsdl_cache_ttl', '0');
define('WSDL', 'http://api.cba.am/exchangerates.asmx?wsdl');
$error = false;
try {
@nicbell
nicbell / 1_primitive_comparison.js
Last active September 23, 2022 16:56
JavaScript object deep comparison. Comparing x === y, where x and y are values, return true or false. Comparing x === y, where x and y are objects, returns true if x and y refer to the same object. Otherwise, returns false even if the objects appear identical. Here is a solution to check if two objects are the same.
//Primitive Type Comparison
var a = 1;
var b = 1;
var c = a;
console.log(a == b); //true
console.log(a === b); //true
console.log(a == c); //true
console.log(a === c); //true
@jasonruyle
jasonruyle / UFW_ban_country.md
Last active May 26, 2024 22:06
UFW to block countries
@niksumeiko
niksumeiko / git.migrate
Last active July 10, 2024 14:29
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@tstone2077
tstone2077 / git-cloneall
Last active October 28, 2022 08:53
Clones as usual but creates local tracking branches for all remote branches.
#!/bin/bash
# Clones as usual but creates local tracking branches for all remote branches.
# To use, copy this file into the same directory your git binaries are (git, git-flow, git-subtree, etc)
clone_output=$((git clone "$@" ) 2>&1)
retval=$?
echo $clone_output
if [[ $retval != 0 ]] ; then
exit 1
@psobot
psobot / phone_prefixes.json
Last active February 2, 2022 11:02
Mapping of phone number prefixes to geographic coordinates, countries and regions.
{
"+1": [[63.004759, -99.392855], "Canada"],
"+1242": [[26.215829, -98.187851], "Bahamas"],
"+1246": [[13.186666, -59.55727], "Barbados"],
"+1264": [[18.217056, -63.050923], "Anguilla"],
"+1268": [[17.08682, -61.796431], "Antigua and Barbuda"],
"+1284": [[18.719042, -64.326495], "British Virgin Islands"],
"+1340": [[33.282206, -117.185162], "US Virgin Islands"],
"+1345": [[19.323764, -81.195721], "Cayman Islands"],
"+1441": [[32.301277, -64.77506], "Bermuda"],
@ygotthilf
ygotthilf / jwtRS256.sh
Last active July 14, 2024 00:03
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@vasanthk
vasanthk / System Design.md
Last active July 15, 2024 10:23
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?