Skip to content

Instantly share code, notes, and snippets.

@drewwells
drewwells / view.tmpl
Created December 29, 2013 07:33
Basic template using a pipeline
<div>{{titleExpand .Title}}</div>
@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 / 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 / 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
$(".hdr-container, h2, h1, .offer-type, label").hide(); $("textarea").attr('rows',2);
function focus(){
$("#domain").focus();
}
$('form').off('submit',focus).on('submit',focus);
''
var b='';function foo(a){if(a){b+=a+' ';return foo}else{console.log(b)}};foo("lol")("wat")("bar")();
[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
@drewwells
drewwells / criticalcss-bookmarklet-devtool-snippet.js
Last active December 22, 2015 11:58 — forked from PaulKinlan/criticalcss-bookmarklet-devtool-snippet.js
Add reporting at the end. I build the original CSS from webkit's parser. The original CSS will be larger than this if no minification is used.
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@drewwells
drewwells / gist:6322177
Created August 23, 2013 18:00
Test what browsers autoprefixer is working with.
var autoprefixer = require('autoprefixer');
var prefixed = autoprefixer("android 4", "ios 7", "ios 6.1", "ff 23", "ios 6", "android 2.3", "android 2.2").inspect();
console.log(prefixed)
@drewwells
drewwells / gist.go
Last active November 25, 2015 17:30
// Package classification API.
//
// the purpose of this application is to provide an application
// that is using plain go code to define an API
//
//
// Schemes: https
// Host: localhost
// Version: 0.0.1
//