This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
var serialport = require('node-serialport') | |
var sp = new serialport.SerialPort("/dev/ttyO3", { | |
parser: serialport.parsers.raw, | |
baud: 9600 | |
}) | |
sp.on('data', function(chunk) { | |
console.log(chunk.toString('hex'), chunk.toString(), chunk) | |
}) |
$ git clone github:lenary/guides.git | |
Cloning into guides... | |
remote: Counting objects: 255, done. | |
remote: Compressing objects: 100% (216/216), done. | |
remote: Total 255 (delta 111), reused 163 (delta 35) | |
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done. | |
Resolving deltas: 100% (111/111), done. | |
$ cd guides | |
$ git remote -v |
function getTrilateration(position1, position2, position3) { | |
var xa = position1.x; | |
var ya = position1.y; | |
var xb = position2.x; | |
var yb = position2.y; | |
var xc = position3.x; | |
var yc = position3.y; | |
var ra = position1.distance; | |
var rb = position2.distance; | |
var rc = position3.distance; |
# If your workers are inactive for a long period of time, they'll lose | |
# their MySQL connection. | |
# | |
# This hack ensures we re-connect whenever a connection is | |
# lost. Because, really. why not? | |
# | |
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) | |
# | |
# From: | |
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ |
#telnet into the drone (telnet 192.168.1.1) | |
#paste the following command: | |
killall udhcpd; iwconfig ath0 mode managed essid [ssid]; ifconfig ath0 [wanted ip] netmask 255.255.255.0 up; | |
#ex. killall udhcpd; iwconfig ath0 mode managed essid Roflcopter; ifconfig ath0 192.168.43.201 netmask 255.255.255.0 up; |
sudo apt-get install postgresql-9.6 postgresql-server-dev-9.6 postgresql-contrib-9.6 -y | |
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'" | |
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'" | |
sudo systemctl stop postgresql | |
sudo su - postgres -c '/usr/lib/postgresql/9.6/bin/pg_upgrade -b /usr/lib/postgresql/9.3/bin -B /usr/lib/postgresql/9.6/bin \ | |
-d /var/lib/postgresql/9.3/main/ -D /var/lib/postgresql/9.6/main/ \ | |
-O "-c config_file=/etc/postgresql/9.6/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.3/main/postgresql.conf" --link' | |
sudo apt-get remove postgresql-9.3 -y |
#!/bin/sh | |
# | |
# git-snapshot.sh - save junk code to a snapshots branch | |
# | |
# USAGE: git-snapshot.sh [-m message] [files...] | |
# | |
# Run `git add files` and then create a new commit on branch 'snapshot' | |
# with two parents, the previous snapshot and HEAD. | |
# | |
# If -m is given, the 'message' is used as the commit message; otherwise |
# If you're getting this error trying to use ApacheBench on OS X Lion: | |
# Benchmarking mwmanning.com (be patient)...apr_socket_recv: Connection reset by peer (54) | |
# | |
# You need to download the latest beta version of Apache and rebuild ab. | |
# Here's how (assuming you have homebrew installed). | |
# Install Homebrew (https://github.com/mxcl/homebrew) and then the Perl Regex support | |
brew install pcre | |
# Download the latest from http://httpd.apache.org/download.cgi, then decompress and compile it |
Dear soon-to-be-former user, | |
We've got some fantastic news! Well, it's great news for us anyway. You, on | |
the other hand, are fucked. | |
We've just been acquired by: | |