Skip to content

Instantly share code, notes, and snippets.

View randallb's full-sized avatar
🎬

Randall Bennett randallb

🎬
View GitHub Profile
Template in HTML:
<widget>
This is a widget
</widget>
After compilation:
<widget ng-click="standardMethod">
This is a widget.
</widget
var numberConv;
numberConv = function(x) {
var octet1, octet2, octet3, octet4;
octet1 = x % 256;
octet2 = Math.floor(x / 256);
octet3 = Math.floor(x / (256 * 256));
octet4 = Math.floor(x / (256 * 256 * 256));
return new Buffer([octet1, octet2, octet3, octet4]);
};
@randallb
randallb / gist:5122003
Created March 9, 2013 01:21
New stencil format
<ul playlist>
<li entry>
</li>
</ul>
<ul queue>
<li entry>
</li>
.response.transition-from{
max-height: 0px;
}
.response.transition-to{
max-height: 1000px;
}
.response.transition-out{
opacity: 0;
{"author_image":null,
"author_name":null,
"created_at":null,
"id":null,
"message":null,
"updated_at":null,
"entry_type":"FacebookPost", (Could also be "TwitterPost" or "CustomPost")
"service_data":{ DATA FROM FACEBOOK OR TWITTER},
"facebook?":true,
"twitter?":false,
#= require angular/angular-mocks.js
fn = (suiter) ->
describe "awesome", ->
it "should be cool", ->
console.log "success!"
console.log suiter
fn("suit")
class Scene < ActiveRecord::Base
has_and_belongs_to_many :buttons
has_many :overlay_buttons
has_many :flag_buttons
has_many :ticker_buttons
has_many :bug_buttons
has_many :background_buttons
has_many :other_buttons
has_many :preset_buttons
has_many :button_groups
# Description:
# Hubot will listen for potential math band names.
#
# Dependencies:
# Requires an inflector. (http://code.google.com/p/inflection-js/)
#
# Configuration:
# None
#
# Commands:
var mod;
mod = angular.module('sceneServices', ['ngResource']);
mod.factory('sceneResource', function($resource) {
return $resource("/sceenz.json");
});
@randallb
randallb / gist:3299513
Created August 8, 2012 22:46
Vidpresso pusher thing.
util = require "util"
exec = require("child_process").exec
module.exports = (robot) ->
robot.router.post "/github", (req, res) ->
payload = JSON.parse req.body.payload
if payload.ref is "refs/heads/master"
robot.messageRoom 'github', "Recieved master, deploying to production."
child = exec "/app/pullpushprod.sh", (err, stdout, stderr) ->