Skip to content

Instantly share code, notes, and snippets.

View snikch's full-sized avatar
🎛️

Mal Curtis snikch

🎛️
  • inMusic
  • Auckland, New Zealand
  • 08:08 (UTC +12:00)
  • X @snikchnz
View GitHub Profile
@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 / 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 / install.md
Last active August 29, 2015 14:22
Raspberry Pi syncronised airplay installation

Install Raspbian

Install raspbian via NOOBs. Seems all g.

Install shairplay

Prerequisites

# Update Packages
@snikch
snikch / README.md
Created February 5, 2014 22:18
Apostle Rails testing

Testing an apostle-rails Integration

This document gives examples using RSpec, but the concepts should apply to any testing framework.

Turn off delivery

In test, we recommend turning off delivery. You can do this in a spec helper, or similar. All calls to #deliver will return true.

require 'apostle'
@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 / 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 / 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 / test.rb
Last active January 6, 2022 13:18
Convert a UUID to UTF-8 encoding to visually shorten.
>> code = Urlcode.uuid_to_code("4c3559f0-cd95-482f-a27d-b2bbc68523ef")
=> "䰵姰축䠯ꉽ늻욅⏯"
>> Urlcode.code_to_uuid(code)
=> "4c3559f0-cd95-482f-a27d-b2bbc68523ef"
@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.

{
"title": "Talk Getting Started in the Industry with the Experts",
"description": "<p> Welcome to Learnable - SitePoint's online learning site and the new home of Talk with the Experts.<p><br><br><p>Next in our free Talk with the Experts series we're talking about <b>getting started in the industry</b> with SitePoint devs <bold>Jude Aakjaer and Ben Axnick</bold> (who came in through our graduate intern program). </p><p>Session time: <b>2pm PDT on Wed 1 May</b> <br> <a href='http://www.timeanddate.com/worldclock/fixedtime.html?msg=Talk+Getting+Started+in+the+Industry+with+the+Experts&iso=20130502T07&p1=152&ah=1'>Find out what time it will be at your place here</a></p><br><p>Access to the room will open 15 minutes prior to kick-off.</p>",
"hideLogin": false,
"redirectUrl": null,
"editor": true,
"sessions": {
"primary": {
"date": "This Week: Thursday 18th",
"title": "WordPress with Jeremy Ferguson",