I hereby claim:
- I am onpaws on github.
- I am paws (https://keybase.io/paws) on keybase.
- I have a public key ASBYTLCqxqixhZqWbEbHt8HsAsumyJhzaKIkqoRN2DB-IQo
To claim this, I am signing this object:
If you wake up your laptop and a previous SSH connection is broken, but you want to keep your local shell: | |
[Enter] ~ . |
[ubuntu@myhost ~]$ zdump -v America/New_York | grep 2016 | |
America/New_York Sun Mar 13 06:59:59 2016 UTC = Sun Mar 13 01:59:59 2016 EST isdst=0 gmtoff=-18000 | |
America/New_York Sun Mar 13 07:00:00 2016 UTC = Sun Mar 13 03:00:00 2016 EDT isdst=1 gmtoff=-14400 | |
America/New_York Sun Nov 6 05:59:59 2016 UTC = Sun Nov 6 01:59:59 2016 EDT isdst=1 gmtoff=-14400 | |
America/New_York Sun Nov 6 06:00:00 2016 UTC = Sun Nov 6 01:00:00 2016 EST isdst=0 gmtoff=-18000 |
# Puma can serve each request in a thread from an internal thread pool. | |
# The `threads` method setting takes two numbers a minimum and maximum. | |
# Any libraries that use thread pools should be configured to match | |
# the maximum value specified for Puma. Default is set to 5 threads for minimum | |
# and maximum, this matches the default thread size of Active Record. | |
# | |
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i | |
threads threads_count, threads_count | |
# Specifies the `port` that Puma will listen on to receive requests, default is 3000. |
//fetch() is based on Promises | |
fetch('http://api.github.com/users') | |
.then(result => console.log(result)) | |
//ES7 async/await | |
async function getMovieAsync() { | |
let response = await fetch('http://www.omdbapi.com/?t=The Matrix'); | |
let movie = await response.json(); | |
console.log(movie.Title); | |
} |
I hereby claim:
To claim this, I am signing this object:
/* Sample of using fetch() Promise API */ | |
fetch('http://api.github.com/users') | |
.then(response => console.log(response), error => console.error(error)); | |
//Readable Stream | |
fetch('http://api.github.com/users') | |
.then(response => console.log(response.body), error => console.error(error)); | |
//via https://jakearchibald.com/2015/thats-so-fetch/ | |
fetch('/big-data.csv').then(function(response) { |
arr = ['Brad', 'Dan', 'Jessica','Rachel'] | |
random = Math.floor(Math.random() * arr.length) | |
console.log(arr[random]) |
function eventFire(el, etype){ | |
if (el.fireEvent) { | |
el.fireEvent('on' + etype); | |
} else { | |
var evObj = document.createEvent('Events'); | |
evObj.initEvent(etype, true, false); | |
el.dispatchEvent(evObj); | |
} | |
} | |
eventFire(document.getElementById('submitButton'), 'click'); |
require 'mysql2' | |
client = Mysql2::Client.new(:host => "localhost", :username => "shippable") | |
results = client.query('use mysql') |
# gleaned from BCantrill's Google talk via | |
# https://www.youtube.com/watch?v=6chLw2aodYQ | |
sudo dtrace -n syscall:::entry | |
sudo dtrace -n syscall:::entry{trace(execname)} | |
sudo dtrace -n syscall:::entry'{@[execname] = count()}' #@ means aggregation in D | |
#how manys syscalls did Chrome Canary make? | |
sudo dtrace -n syscall:::entry/execname == "Google Chrome Ca"/{@[probefunc] = count()} |