- Jim Weirich: The Building Blocks of Modularity – http://goo.gl/g4Nk
- Jim Weirich: SOLID Ruby – http://goo.gl/z3jd
- Sandi Metz: SOLID Object-Oriented Design – http://goo.gl/PDn6T
- Sandi Metz: Less – The Path to Better Design – http://goo.gl/VuTl4
- Demeter is for Encapsulation – http://is.gd/eeyLx
- Opinionated Modular Code – http://is.gd/eeyXm
- Scaling to Hundreds of Millions of Requests – http://vimeo.com/12814529
- Confident Code – http://goo.gl/VFLX
- Destroy All Software Screencasts – https://www.destroyallsoftware.com/screencasts
- Corey Haines: Fast Rails Tests – http://goo.gl/Va2gb
This file contains 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
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
This file contains 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
import usb.core | |
import usb.util | |
import usb.control | |
import time | |
import decimal | |
INTERFACE_NUMBER = 5 | |
TIMEOUT = 2000 |
This file contains 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
-- show running queries | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '' AND query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- kill running query | |
SELECT pg_cancel_backend(procpid); | |
-- kill idle query |
This file contains 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
async function generateKey() { | |
return await crypto.subtle.generateKey({ | |
"name":"AES-GCM", | |
"length":256 | |
},true,['encrypt','decrypt']); | |
} | |
async function exportKey(key) { | |
return await crypto.subtle.exportKey('jwk', key); | |
} |
This file contains 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
// Generate unique IDs for use as pseudo-private/protected names. | |
// Similar in concept to | |
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>. | |
// | |
// The goals of this function are twofold: | |
// | |
// * Provide a way to generate a string guaranteed to be unique when compared | |
// to other strings generated by this function. | |
// * Make the string complex enough that it is highly unlikely to be | |
// accidentally duplicated by hand (this is key if you're using `ID` |
This file contains 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
#!/usr/bin/env bash | |
#VERSION='2.0.0-p353' | |
VERSION='2.1.0' | |
PKGNAME='ruby2.1' | |
CONFIGURE_OPTS='--disable-install-rdoc' | |
apt-get install ruby rubygems -y | |
gem install fpm --no-ri --no-rdoc |
This file contains 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
# Run this in your shell to install a set of atom-plugins | |
# for working with rust projects and git | |
# Rust essentials | |
apm install language-rust racer linter linter-rust build build-cargo cargo-test-runner rust-api-docs-helper | |
# Other | |
apm install keyboard-localization autoupdate-packages project-manager atom-terminal minimap docblockr theme-switcher | |
# Git |
This file contains 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
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
echo '# rbenv setup' > /etc/profile.d/rbenv.sh | |
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh | |
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh | |
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh | |
chmod +x /etc/profile.d/rbenv.sh | |
source /etc/profile.d/rbenv.sh | |
git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build | |
rbenv install 1.9.3-p392 |