Skip to content

Instantly share code, notes, and snippets.

View gist:55a53a7a2dd966c78152
var module = angular.module("device-picker", ['ng']);
module.controller("bla", ['$scope', function ($scope) {
console.log("HAI");
}]);
View gist:b7bf942779e2121b97c9
def upgrade():
op.add_column('control_assessments', sa.Column('control_id', sa.Integer()))
op.create_foreign_key('fk_control_control_assessment', 'control_assessments', 'controls', ['control_id'], ['id'])
def downgrade():
op.drop_column('control_assessments', 'control_id')
op.drop_constraint('fk_control_control_assessment', 'control_assessments', 'controls')
View gist:783777
Build CSS of project CSS with configuration Release
PhaseScriptExecution "Run Script" build/CSS.build/Release/CSS.build/Script-3AA91CF412C8FE8000132A25.sh
cd /Users/Swizec/Documents/opensauce/kod/deps/libcss/cocoa-framework
setenv ACTION build
setenv ALTERNATE_GROUP Swizec
setenv ALTERNATE_MODE u+w,go-w,a+rX
setenv ALTERNATE_OWNER Swizec
setenv ALWAYS_SEARCH_USER_PATHS NO
View gist:1046888
my test:
'new track event': function (done) {
dispatcher.on('track new', function (url) {
// this fails with a mismatch
assert.equal(url, 'http://jc.is/lXFpfE');
done();
});
counter.track(3, 'http://jc.is/lXFpfE', function () {
View gist:1449124
var _ = require('underscore'), states = {};
var tm = function(S, step, end){
if (_.keys(s).indexOf(end)>=0) return true;
var _step = {};
for(var k in step){
var i = step[k][0],
tape = step[k][1],
@Swizec
Swizec / dabblet.css
Created Mar 30, 2012
The first commented line is your dabblet’s title
View dabblet.css
/**
* The first commented line is your dabblet’s title
*/
body {
min-height: 100%;
}
#main {
display: box;
@Swizec
Swizec / dabblet.css
Created Mar 30, 2012
The first commented line is your dabblet’s title
View dabblet.css
/**
* The first commented line is your dabblet’s title
*/
#body {
min-height: 100%;
background: beige;
width: 100%;
}
#main {
@Swizec
Swizec / assets.rake
Last active Oct 3, 2015
Webpack rails configs
View assets.rake
# lib/tasks/assets.rake
# The webpack task must run before assets:environment task.
# Otherwise Sprockets cannot find the files that webpack produces.
Rake::Task["assets:precompile"]
.clear_prerequisites
.enhance(["assets:compile_environment"])
namespace :assets do
# In this task, set prerequisites for the assets:precompile task
task compile_environment: :webpack do
View settings.py
AttributeError at /admin/
'Settings' object has no attribute 'DATABASE_ENGINE'
Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.4
Exception Type: AttributeError
Exception Value:
'Settings' object has no attribute 'DATABASE_ENGINE'
Exception Location: /usr/local/lib/python2.7/dist-packages/django/utils/functional.py in inner, line 185
Python Executable: /usr/bin/python
@Swizec
Swizec / highlighter.java
Created May 23, 2012
how to extend this?
View highlighter.java
/**
* boilerpipe
*
* Copyright (c) 2009 Christian Kohlschütter
*
* The author licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0