- look for stared repos in your Github account [TODO: link to API]
- Google it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
def if_true | |
yield | |
self | |
end | |
def if_false | |
self | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ARABIC_ROMAN_MAP = [ | |
["M", 1000], | |
["CM", 900], | |
["D", 500], | |
["CD", 400], | |
["C", 100], | |
["XC", 90], | |
["L", 50], | |
["XL", 40], | |
["X", 10], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ARABIC_ROMAN_MAP = [ | |
["M", 1000], | |
["CM", 900], | |
["D", 500], | |
["CD", 400], | |
["C", 100], | |
["XC", 90], | |
["L", 50], | |
["XL", 40], | |
["X", 10], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert into | |
trailing_spaces (value) | |
select | |
case | |
when mod(indx, 9) = 0 then 'A' || (random() * 100)::text || ' ' | |
when mod(indx, 10) = 0 then ' B' || (random() * 100)::text | |
else 'C' || (random() * 100)::text | |
end | |
from | |
generate_series(1, 1000000) as d (indx) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"indentRainbow.colors": [ | |
"rgba(46,52,64,0.5)", | |
"rgba(59,66,82,0.5)", | |
"rgba(67,76,94,0.5)", | |
"rgba(76,86,106,0.5)", | |
"rgba(87,98,121,0.4)", | |
"rgba(97,110,136,0.3)", | |
"rgba(109,122,150,0.2)", | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DEPRECATED checkout my dotfiles/install script for the up to date version | |
# https://github.com/dmshvetsov/dotfiles/blob/master/install | |
set -e | |
ssh -q [email protected] | true | |
if [ $? -eq 0 ]; then | |
echo "SSH to github OK" | |
else | |
echo "Cannot connect to github via SSH. Are you added your SSH key to your github account?" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Generate self signed root CA cert | |
openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=root/CN=`hostname -f`/[email protected]" | |
# Generate server cert to be signed | |
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=server/CN=`hostname -f`/[email protected]" | |
# Sign the server cert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
ssh -q [email protected] | true | |
if [ $? -eq 0 ]; then | |
echo "SSH to github OK" | |
else | |
echo "Cannot connect to github via SSH. Are you added your SSH key to your github account?" | |
exit | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Usage: | |
-- select * from users where id = to_locid('VXNlcjozNg=='); | |
create or replace function to_locid(globid text) returns int as $$ | |
begin | |
return (split_part(encode(decode(globid, 'base64'), 'escape'), ':', 2))::int; | |
end; | |
$$ language plpgsql; |