Skip to content

Instantly share code, notes, and snippets.

View earnubs's full-sized avatar

Stephen Stewart earnubs

View GitHub Profile
@earnubs
earnubs / gist:1316575
Created October 26, 2011 14:50 — forked from tmc/gist:828553
%s/Controller/Router/g
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Backbone example</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="underscore.js"></script>
<script type="text/javascript" src="backbone.js"></script>
@earnubs
earnubs / yui-config
Created September 20, 2012 13:29
YUI config
YUI({
comboBase: '/yui3?',
combine: true,
root: 'build/',
groups: {
contrib: {
comboBase: '/yui3-contrib?',
combine: true,
// explicitly list the modules and deps, this improves combohandler bundling of
// script requests
@earnubs
earnubs / index.html
Created October 25, 2012 11:09
YUI Panels
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<script src="http://yui.yahooapis.com/3.7.2/build/yui/yui-min.js"></script>
<script src=panels.js></script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.7.3/build/cssreset/cssreset-min.css">
<link rel="stylesheet" type="text/css" href="panels.css">
<title>YUI Panels</title>
@earnubs
earnubs / dial.js
Created November 24, 2012 00:10
iplayer radio
YUI().use('node', 'event-move', 'event-touch', function(Y) {
// TODO key shortcuts, up, down, left, right, hjkl?
// TODO gestures
var dial = Y.one('.dial'),
viewer = Y.one('.viewer ul'),
origin = dial.getXY(),
rotation = 0,
last = {},
mass = 300, // 345 is close to 1:1 at edge
@earnubs
earnubs / Vagrantfile
Last active August 29, 2015 13:57
Basic Vagrantfile...
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision "ansible" do |ansible|
ansible.playbook = "PATH/TO/site.yml"
ansible.host_key_checking = false
@earnubs
earnubs / .gitignore
Last active August 29, 2015 13:59
command line Y.Template.Micro compiler
node_modules
body {
background-color:orange;
}
.foo {
background-color:lime;
}
div {
border:4px solid black;
#!/bin/bash
PROJECT_ROOT="/path/to/project/"
API_PATH="$PROJECT_ROOT/api/workspace"
WEB_PATH="$PROJECT_ROOT/web/workspace"
cd $API_PATH
tmux new-session -d -s appstore "make build run"
tmux rename-window 'Logs'
'use strict';
module.exports = function(grunt) {
grunt.registerMultiTask('blanket', 'Instrument files with Blanket.js', function() {
var blkt = require("blanket")({
"data-cover-flags": ['*.js']
});
@earnubs
earnubs / gulpfile.js
Last active August 29, 2015 14:05
yui module build
var buffer = require('vinyl-buffer');
var concat = require('gulp-concat');
var fs = require('fs');
var gulp = require('gulp');
var src = require('vinyl-fs').src;
var tap = require('gulp-tap');
var through = require('through2');
var uglify = require('gulp-uglify');
var paths = {