Skip to content

Instantly share code, notes, and snippets.

View pushcx's full-sized avatar

Peter Bhat Harkins pushcx

View GitHub Profile
location ~ ^/(wp-admin|wp-login\.php|priv\.dog|companies\/sidekick) {
deny all;
break;
}
# file extensions that should never be served, this prevents
# potential malicious downloads in case someone manages to manipulate
# a Rails URL or write a file that can be served
# (~* matches case-insensitive)
location ~* \.(?:git|svn|DS_Store|asp|aspx|cgi|pt|pl|idx|php|exe|scpt|AppleScript|dll|dmg|pif|msi|application|msp|com|scr|hta|cpl|gadget|msc|jar|bat|vb|vbs|vbe|ws|wsh|inf|lnk|reg|scf|wsc|wsh|ps1|ps1xml|ps2|ps2xml|psc1|psc2|msh|msh1|msh2|mshxml|msh1xml|msh2xml)$ {
deny all;
{
:error => {
:code => "missing",
:message => "Cannot charge a customer that has no active card",
:param => "card",
:type => "card_error"
}
}
@pushcx
pushcx / lwd-git.md
Last active August 29, 2015 14:05
Introduction to Version Control and Git to Lakefront Web Developers
/*
Closures as Family
Hi, I'm Peter Harkins - @pushcx
notes will be online at http://gist.github.com/pushcx
*/
function mom() {

Immutable Ruby

Libraries I talked about

  • ice_nine: Deep freeze ruby objects
  • Values: Simple immutable value objects for ruby
  • immutable_attributes: specify attributes within an ActiveRecord model that can be set but not modified
  • hamster: Efficient, Immutable, Thread-Safe Collection classes for Ruby

Next Steps

@pushcx
pushcx / intro
Created October 9, 2013 01:43
Intro to Git Workshop for Chicago Web Professionals 2013-10-08
Intro to Git
------------
Peter Harkins @pushcx http://push.cx
These notes will be available at http://gist.github.com/pushcx/ .... (TBD end
of prez)
If you haven't yet installed Git and want to follow along the exercise, visit:
http://git-scm.com/downloads
The WiFi network is named "BooCoo" and the password is "blackcoffee"
# an interative animation queue for Crafty
Crafty.c "AnimationQueue",
init: ->
@requires("Tween")
@step_done_callback = undefined
# animations should be an array of hashes with the keys
# tween: a hash that gets passed to tween()
# frames: number of frames, passed to tween()
# callback: optional, a callback to run after this step completes
id | name | convert_from
--------+------------------------------------------------+-----------------------------------------------
173111 | História | História
172431 | fantasía | fantasía
164181 | Niterói | Niterói
164171 | D&D Niterói DAEMON niteroi Dungeons & Dragons | D&D Niterói DAEMON niteroi Dungeons & Dragons
163331 | Máscara | Máscara
(5 rows)
@pushcx
pushcx / gist:5535312
Created May 7, 2013 19:15
command to convert pdf into tiffs
mkdir pages
gs -sDEVICE=pnggray -sOutputFile=pages/p%05d.png -r600 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dBATCH -dNOPAUSE -dSAFER -f filename.pdf -c quit
-sDEVICE is formatting, load ghostscript and run 'devicenames ==' to print the full list. 'tiffgray' for tiff
-sOutputFile is filename, can have paths, basic printf formatting for page number
-r is resolution, 150 is human reading, 300 is ocr/print, 600 is art printing
Don't need to edit later parameters except 'filename.pdf'
-AlphaBits are antialiasing, rest just gets it running on all pages non-interactively
defutf8 on
startup_message off
nethack off
deflogin off
vbell_msg " bell in %n"
autodetach on
multiuser on
shell -$SHELL
defscrollback 10000