Skip to content

Instantly share code, notes, and snippets.

View tonyhb's full-sized avatar
🕳️
void

Tony Holdstock-Brown tonyhb

🕳️
void
View GitHub Profile
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bitcoin Payroll</title>
<script src="/assets/js/libs/modernizr.js"></script>
<link rel="stylesheet" href="/assets/css/bootstrap.css" />
<link rel="stylesheet" href="/assets/css/flat-ui.css" />
<link rel="stylesheet" href="/assets/css/app.css" />
</head>
require 'amazon/ecs'
module Amazon
class Ecs
def self.cart_similarities(asin)
opts = {
service: 'AWSECommerceService',
operation: 'CartCreate',
response_group: 'CartSimilarities'
}
@tonyhb
tonyhb / gulpfile.js
Created March 9, 2014 20:52
Karma + RequireJS: Mismatched anonymous define error
var gulp = require('gulp');
// Plugins
var karma = require('gulp-karma');
// Paths
var basePath = './public/assets/';
var paths = {
spec: basePath + 'spec/'
};
@tonyhb
tonyhb / gulpfile.js
Last active January 3, 2016 22:49
Base gulpfile.js for most projects - Gulp v3.5.2
var gulp = require('gulp');
// Plugins
var imagemin = require('gulp-imagemin'),
compass = require('gulp-compass'),
coffee = require('gulp-coffee');
// Paths
var basePath = './public/assets/',
sassPath = basePath + 'sass/',
@tonyhb
tonyhb / Proxy response.html
Created January 18, 2014 20:02
browser-sync demo HTML page
<!doctype html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8">
<meta name="csrf" value="964a40834151e0c9abdcfa5a141601e698d3fc20">
<meta name="mixpanel" value="">
<link rel="stylesheet" href="/css/app.css?ver=1" media="all">
<script src="/js/libs/modernizr.js" type="text/javascript"></script>
@tonyhb
tonyhb / replace.coffee
Last active February 8, 2017 15:04
Marionette.Region.replace: Show and hide regions with a fadeIn/fadeOut animation
Marionette.Region.prototype.replace = (view, speed) ->
speed = speed || 150
if ! @currentView
@show(view)
return
@ensureEl()
isViewClosed = view.isClosed || _.isUndefined view.$el
isDifferentView = view isnt @currentView
view.render()
@tonyhb
tonyhb / gist:6414392
Last active December 22, 2015 03:59
KeyRemap4MacBook - MyType Left Shift + Left Alt/Option to Function Keys
<?xml version="1.0"?>
<root>
<item>
<name>Holding LShift_LCommand+1,2,3,4,... to F1,F2,F3,...,F12</name>
<appendix>Holding LShift+LOption+1 to F1</appendix>
<appendix>Holding LShift+LOption+2 to F2</appendix>
<appendix>Holding LShift+LOption+3 to F3</appendix>
<appendix>Holding LShift+LOption+4 to F4</appendix>
<appendix>Holding LShift+LOption+5 to F5</appendix>
<appendix>Holding LShift+LOption+6 to F6</appendix>
@tonyhb
tonyhb / cookie.go
Created June 20, 2013 18:14
The beginnings of a golang Cookie setter and session manager. And then I realised Gorilla Toolkit had a sessions library.
@tonyhb
tonyhb / main.go
Created June 20, 2013 00:19
Golang: Converting a struct to a map (to a url.Values string map)
package main
import (
"fmt"
"net/url"
"reflect"
"strconv"
)
type Person struct {
@tonyhb
tonyhb / game.coffee
Created October 30, 2012 22:40
Game State
# Contains the game state in a protected (closure) variable
state : ->
# Our protected variable, only changeable through the setState method
# defined below
_state = 'stopped'
# The state method will (from the 2nd call onwards) only return the
# state.
@.state = ->
_state