Skip to content

Instantly share code, notes, and snippets.

View nickpresta's full-sized avatar

Nick Presta nickpresta

View GitHub Profile
L=$HOME; cd $L; curl -o lr.mp3 "http://images2.mob.org/file_exchange/melodies_files/42670_wapres_ru.mp3" && curl -o lr.png http://i.imgur.com/0vusjnF.png && open -a "Preview" "$L/lr.png" && osascript -e "set Volume 3" && afplay lr.mp3 --volume 6;
End of Game 2:
Twitch: 585,000 viewers
Youtube: 119,000 viewers
Azubu: 134,000 viewers (counter update)
Fengyunzhibo: 629,000 viewers
Tencent Chinese Stream: Unknown
Afreeca (Korea): Unknown
Total Peak confirmed: 1,467,000
$ npm install -g grunt bower
THEN
$ npm install -g yo
$ npm install -g generator-webapp
$ yo webapp
$ grunt server
OR
@nickpresta
nickpresta / rasterize.coffee
Last active December 26, 2015 05:49
HTML to PDF/PNG renderer using PhantomJS 1.9.2
# Written by Nick Presta (nick@nickpresta.ca)
# Released under the MIT license.
# See: https://gist.github.com/NickPresta/7103718
page = require('webpage').create()
system = require 'system'
usage = ->
console.log 'Usage: rasterize.coffee -url URL -paper [paperwidth*paperheight|paperformat] -format pdf -output output [< stdin]'
console.log ' Examples:'
console.log ' phantomjs rasterize.coffee -url http://google.com -output /dev/stdout'
@nickpresta
nickpresta / gist:8484834
Created January 18, 2014 01:23
Using gofmt to rewrite 19 files to use a new method signature.
$ gofmt -w -r 'service.client.Do(a, b, c) -> service.client.Do(a, b)' *.go
$ git diff
- resp, err := service.client.Do(req, accounts, false)
+ resp, err := service.client.Do(req, accounts)
- resp, err := service.client.Do(req, business, false)
+ resp, err := service.client.Do(req, business)
# continues on for dozens more lines
@nickpresta
nickpresta / gist:8694734
Last active August 29, 2015 13:55
Vim 7.4.0.52 from Homebrew blows up
$ brew update
Already up-to-date.
$ rm -rf ~/.npm
$ rm -rf node_modules/
$ time npm install --cache-min 9999999
npm WARN package.json accounting@1.0.0 No repository field.
npm http GET https://registry.npmjs.org/grunt
npm http GET https://registry.npmjs.org/grunt-contrib-less/0.9.0
npm http GET https://registry.npmjs.org/load-grunt-tasks
npm http 200 https://registry.npmjs.org/load-grunt-tasks
npm http GET https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-0.1.3.tgz
npm http 200 https://registry.npmjs.org/grunt-contrib-less/0.9.0
  1. Smaller.
  2. Better UI (uses cards, can reorder them, only the card you select shows a number making it easier to read and copy the number).
  3. Can rename issuer and ID.
  4. Manual setup options.
  5. Needs fewer permissions.
  6. Open source, so people can inspect the code to be sure it's not doing anything sneaky.
  7. QR code scanning is faster and less finnicky.
import pika
import sys
import logging
logging.basicConfig(level=logging.INFO)
def sales_handler(ch, method, properties, body):
print " [x] %r:%r" % (method.routing_key, body,)
def refund_handler(ch, method, properties, body):
print " [x] %r:%r" % (method.routing_key, body,)
def chargeback_handler(ch, method, properties, body):

Keybase proof

I hereby claim:

  • I am nickpresta on github.
  • I am nickpresta (https://keybase.io/nickpresta) on keybase.
  • I have a public key whose fingerprint is A248 2595 433F F5B7 0684 8BBF 0E4E 5A56 5EFD FFD6

To claim this, I am signing this object: