Skip to content

Instantly share code, notes, and snippets.

[diff]
tool = custom
[merge]
tool = custom
[mergetool "custom"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepTemporaries = false
trustExitCode = false
keepBackup = false
define([
"../core",
"../queue",
"../effects" // Delay is optional because of this dependency
], function( jQuery ) {
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
jQuery.fn.delay = function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
var b='';function foo(a){if(a){b+=a+' ';return foo}else{console.log(b)}};foo("lol")("wat")("bar")();
$(".hdr-container, h2, h1, .offer-type, label").hide(); $("textarea").attr('rows',2);
function focus(){
$("#domain").focus();
}
$('form').off('submit',focus).on('submit',focus);
''
@drewwells
drewwells / Guardfile
Created November 26, 2013 20:12
Why I use guard
group :www do
guard :compass, :configuration_file => www, :compile_on_start => true do
watch(%r{www\/gui\/sass\/.*\.sass$})
end
guard :livereload do
watch(%r{www\/gui\/build\/js\/.+\.(js)$})
watch(%r{www\/gui\/build\/css\/.+\.(css)$})
end
@drewwells
drewwells / file.heirarchy
Last active December 31, 2015 02:19
feature! based off file conventions Example test specific implementation map. These files will get rolled up and compared against what test(s) are active. The plugin will need to be invoked `require(['feature!module'])`.
/includes/template/implementation.php
/includes/template/tests/<RMN-NUM>/implementation.php
/includes/template/tests/<RMN-NUM>/offer.php
/www/gui/scripts/tests/<RMN-NUM>/override.js
@drewwells
drewwells / enumerate.go
Created December 27, 2013 21:34
Enumerate the properties of a type. valueField throws errors when dealing with unexported fields
func enumerate(x interface{}) {
val := reflect.ValueOf(x).Elem()
i := 0
for {
if(i >= val.NumField()){
break
}
//valueField := val.Field(i)
typeField := val.Type().Field(i)
@drewwells
drewwells / view.tmpl
Created December 29, 2013 07:33
Basic template using a pipeline
<div>{{titleExpand .Title}}</div>
@drewwells
drewwells / inheritance.go
Created January 10, 2014 20:44
Inheritance example in Go
package main
import "fmt"
type Car struct {
wheelCount int
}
// define a behavior for Car
func (car Car) numberOfWheels() int {
@drewwells
drewwells / index.js
Created February 6, 2014 06:42
run via `casper test index.js`
var base = 'http://m.retailmenot.test';
var url = base + '/view/macys.com';
function getCookie (page, name) {
var cookies = page.cookies;
var val;
cookies.forEach(function (cookie) {
if (cookie.name === name) {
val = cookie.value;
}