Skip to content

Instantly share code, notes, and snippets.

View snikch's full-sized avatar
🎛️

Mal Curtis snikch

🎛️
  • inMusic
  • Auckland, New Zealand
  • 14:54 (UTC +12:00)
  • X @snikchnz
View GitHub Profile
@snikch
snikch / README.md
Last active December 20, 2015 17:39

Serving Non-Fingerprinted Cached Assets on Heroku

Requirements:

  • Assets are accessed unfingerprinted (e.g. /assets/application.js)
  • Rack::Cache is enabled
  • Assets are gzipped
  • Assets are precompiled
  • Assets are sent to the browser when updated in source control / the filesystem

This is not as easy as it sounds. By default, when rack cache is enabled, files requested from the filesystem via Rack::Static are cached, and therefore when the file changes, those changes are not reflected in the cache, and stale assets are served up.

@snikch
snikch / Podfile
Last active December 27, 2015 14:58
Slow pod install. Mac OS 10.9.0 Mavericks Ruby: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
platform :ios, '6.0'
pod 'HockeySDK'
pod 'Lockbox'
pod 'ViewDeck'
pod 'RestKit'
pod 'SDWebImage'
pod 'DDPageControl'
pod 'MagicalRecord'
pod 'SSPullToRefresh'
pod 'AFOAuth2Client'
@snikch
snikch / README.md
Last active December 29, 2015 03:09
Apostle.io integration

Apostle.io Client Integration Guide

Apostle.io is a web service for managing web app generated emails. This guide describes the requirements for writing a Client Library in any language.

Please check http://github.com/apostle to see if there is a client library for your language already.

This gist lives at https://gist.github.com/snikch/7606139

Style Guide

@snikch
snikch / sample_data.json
Created December 8, 2013 20:59
Apostle.io 'Order' email sample data
{
"customer": {
"name": "Joe Blogs",
"address": "123 Example St,\nFaketown\nNew Zealand"
},
"order": {
"id": "51234",
"date": "25/12/13",
"total": "35",
"tax": "5.60",
@snikch
snikch / interfaces
Created January 18, 2016 05:21
Working Raspberry Pi USB wifi
uto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlamn0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
@snikch
snikch / resque.rake
Created April 12, 2012 21:46 — forked from kenmazaika/Console Output
Start and Stop tasks for resque workers the intelligent way, forking the process for speed and reduced load.
require 'resque/tasks'
namespace :resque do
task :setup => :environment
# From https://gist.github.com/1870642
desc "Restart running workers"
task :restart_workers => :environment do
Rake::Task['resque:stop_workers'].invoke
Rake::Task['resque:start_workers'].invoke
end
@snikch
snikch / dropbox@.service
Created May 30, 2018 05:15
Dropbox Service for Ubuntu 16+
[Unit]
Description=Dropbox as a system service user %i
[Service]
Type=forking
ExecStart=/usr/bin/dropbox start
ExecStop=/usr/bin/dropbox stop
User=%i
Group=%i
# 'LANG' might be unnecessary, since systemd already sets the
@snikch
snikch / gist:2245975
Created March 30, 2012 02:38
Hacking a PL2303 LED Badge in Mac OS (Code Mania attendee badge)
1) Install the PL2303 Lion driver from http://changux.co/osx-installer-to-pl2303-serial-usb-on-osx-lio
2) Install the CrossOver trial http://www.codeweavers.com/products/cxmac/
3) Install the 'LED Mini Board' software as a CrossOver app http://www.prolific.com.tw/eng/downloads.asp?id=31
4) Plug in your device, then symlink the mounted device in /dev to the `dosdevices` folder in your CrossOver app
cd ~/Library/Application\ Support/CrossOver/Bottles/Setup.exe/dosdevices # Where Setup.exe is the CrossOver app that was created
ln -s /dev/cu.PL2303-00001004 com1 # Your /dev/ mount name may be slightly different
@snikch
snikch / keybase.md
Created March 3, 2020 21:47
keybase.md

Keybase proof

I hereby claim:

  • I am snikch on github.
  • I am snikch (https://keybase.io/snikch) on keybase.
  • I have a public key ASBxC7cG-o9JguSQGkfICPIFmoH4LE7GcvVj-Ucxxbjpsgo

To claim this, I am signing this object:

@snikch
snikch / machine.js
Last active October 27, 2020 01:45
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions