Skip to content

Instantly share code, notes, and snippets.

View snikch's full-sized avatar
🎛️

Mal Curtis snikch

🎛️
  • inMusic
  • Auckland, New Zealand
  • 04:16 (UTC +12:00)
  • X @snikchnz
View GitHub Profile
@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 / 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 / Light Weight jQuery Validation Plugin
Created November 23, 2010 06:49
A spec for a light weight jQuery validation plugin with schemas not classes
* Must NOT use class="required" validation
* Must use Javascript objects for validation
var schema = {
options : {
'bubble' : true, // Bubble validation checks to all elements, if false will stop on fail
'blur' : false, // Will not call the validate method on the inputs
'auto' : false, // Will not attempt to apply to all forms, just ID matched forms
'decorator' : 'inline' // Defaults to supplied decorator, but a decorator can be supplied
@snikch
snikch / gist:2582549
Created May 3, 2012 02:05
Prevent AssetNotPrecompiledError before it occurs.
# Checks that the precompile list contains this file or raises an error, in dev only
# Note: You will need to move config.assets.precompile to application.rb from production.rb
def javascript_include_tag *sources
sources.each do |source|
raise "Hey, #{source} is not in the precompile list. This will fall apart in production." unless Rails.application.config.assets.precompile.any? do |matcher|
if matcher.is_a? Proc
matcher.call(source)
elsif matcher.is_a? Regexp
matcher.match(source)
else
# install git
sudo aptitude -y install curl git git-core
# get the vmconfig repo
git clone git@github.com:learnable/vmconfig.git
cd vmconfig
# start the automated script
./learnable-development-vm.sh
class App.ProjectsController extends App.ApplicationController
@scope 'all'
@show: (a,b,c) =>
console.log "SHOWING"
# How do I get my model. Is this just completely wrong?
@snikch
snikch / captions2 plugin
Created October 4, 2010 04:53
JWPlayer 5 Captions Plugin, with y axis margin variable.
package {
import com.longtailvideo.jwplayer.events.ViewEvent;
import com.longtailvideo.jwplayer.events.MediaEvent;
import com.longtailvideo.jwplayer.events.PlayerStateEvent;
import com.longtailvideo.jwplayer.events.PlaylistEvent;
import com.longtailvideo.jwplayer.player.IPlayer;
import com.longtailvideo.jwplayer.player.PlayerState;
import com.longtailvideo.jwplayer.plugins.IPlugin;
import com.longtailvideo.jwplayer.plugins.PluginConfig;
import com.longtailvideo.jwplayer.utils.Logger;
def index
filters = {}
filters[:categories_filter] = params[:categories].split(',') unless params[:categories].blank?
filters[:questions_filter] = params[:questions].split(',') unless params[:questions].blank?
@questions = QuestionFilter.new(filters).questions
end
require 'formula'
class Cgminer < Formula
homepage 'https://github.com/ckolivas/cgminer'
url 'https://github.com/ckolivas/cgminer/archive/v2.11.4.zip'
head 'https://github.com/ckolivas/cgminer.git', :using => :git
md5 'd41d210b03ee16c9ad4cfb439916b30a341dc9b6'
depends_on 'autoconf' => :build
depends_on 'automake' => :build
{
"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",