This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# db/migrate/20120625030355_add_deleted_at_to_user.rb | |
class AddDeletedAtToUser < ActiveRecord::Migration | |
def change | |
add_column :users, :deleted_at, :datetime | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', function() { | |
var formEl = document.querySelector('#the-form'), | |
serializeForm = function(el) { | |
var formData = {}; | |
for (var i = 0, l = el.length; i < l; i++) { | |
var currentEl = el[i]; | |
switch (currentEl.type) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var gulp = require('gulp'), | |
browserify = require('browserify'), | |
livereload = require('gulp-livereload'), | |
source = require('vinyl-source-stream'); | |
gulp.task('browserify', function () { | |
return browserify('./js/src/app.js') | |
.bundle() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git status --porcelain | awk '{print $2}' | xargs stat -f '%m %Sm %N' | sort | cut -d ' ' -f 2- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
// | |
// Global ajax loaders | |
// | |
// This is useful for showing a loading animation, yet still taking | |
// advantage of the default behavior of m.request, which is to wait | |
// for all requests to complete before rendering the view. | |
// | |
// The loader is assumed to already be on the page | |
var loader = document.querySelector('.ajax-loader') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// | |
// WARNING: THE FOLLOWING IS ONLY A TEST OF THE EMERGENCY IN-MEMORY ORM | |
// NO CLAIMS ARE MADE AS TO THE PRACTICALITY OR WEB-SCALE-NESS OF PERFORMING CLIENT-SIDE JOINS | |
//// | |
let l = require('lodash-fp') | |
l.mixin({ id: l.identity }) | |
l.mixin({ prop: l.property }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function leven(a, b){if(a.length == 0) return b.length; if(b.length == 0) return a.length; var matrix = []; /* increment along the first column of each row */ var i; for(i = 0; i <= b.length; i++){matrix[i] = [i]; } /* increment each column in the first row */ var j; for(j = 0; j <= a.length; j++){matrix[0][j] = j; } /* Fill in the rest of the matrix */ for(i = 1; i <= b.length; i++){for(j = 1; j <= a.length; j++){if(b.charAt(i-1) == a.charAt(j-1)){matrix[i][j] = matrix[i-1][j-1]; } else {matrix[i][j] = Math.min(matrix[i-1][j-1] + 1, /* substitution */ Math.min(matrix[i][j-1] + 1, /* insertion */ matrix[i-1][j] + 1)); /* deletion */ } } } return matrix[b.length][a.length]; } | |
function cross(l1, l2, fn) { return l1.map(function (v1) { return l2.map(function (v2) { return fn(v1, v2); }) }) } | |
function zip(l1, l2) { var shorter = l1.length < l2.length ? l1 : l2; return shorter.map(function (v, k) { return [l1[k], l2[k]] }) } | |
function minIdx(l) { return l.indexOf(Math.min.apply(null, l)) } | |
/* throw away the "ta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function leven(a, b){if(a.length == 0) return b.length; if(b.length == 0) return a.length; var matrix = []; /* increment along the first column of each row */ var i; for(i = 0; i <= b.length; i++){matrix[i] = [i]; } /* increment each column in the first row */ var j; for(j = 0; j <= a.length; j++){matrix[0][j] = j; } /* Fill in the rest of the matrix */ for(i = 1; i <= b.length; i++){for(j = 1; j <= a.length; j++){if(b.charAt(i-1) == a.charAt(j-1)){matrix[i][j] = matrix[i-1][j-1]; } else {matrix[i][j] = Math.min(matrix[i-1][j-1] + 1, /* substitution */ Math.min(matrix[i][j-1] + 1, /* insertion */ matrix[i-1][j] + 1)); /* deletion */ } } } return matrix[b.length][a.length]; } | |
function cross(l1, l2, fn) { return l1.map(function (v1) { return l2.map(function (v2) { return fn(v1, v2); }) }) } | |
function zip(l1, l2) { var shorter = l1.length < l2.length ? l1 : l2; return shorter.map(function (v, k) { return [l1[k], l2[k]] }) } | |
function minIdx(l) { return l.indexOf(Math.min.apply(null, l)) } | |
/* throw away the "ta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPMxmaFX8xc6267CK8n5IxDZLYFMB6ADEUEb0wHudlhKB95CTYCt7DGxyIHNCjAdBr5WEPs45jFW9FKNE6fM/QSByH6NXfTbdGQj9Z/Kl+VDtAfiNXuGxU8gAX3p5MQpHQdeTg4ntLdL7UvPnndy4zTeBEsWFEBtbVbaH3r+Of/YdAXbhwCVwzWSVr2Ht6wD8MRnpkC+gWPMsCuO4Cb7xxLy4UnBzUl9j/1Z1DVV3mhPQ1Oz0xw4tFu88V8hMf5EhprrwN87jTck6XZHcjWa/aNHFi42TSQI5orL4VXPqCxQ7gLtm9Zl1a+odUHbH2Evyw2zmJV+2nfwmEKxqy7dvJ tomas@Tomass-MBP.sf.stch.co |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: list | |
list: | |
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null |\ | |
awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' |\ | |
sort |\ | |
egrep -v -e '^[^[:alnum:]]' -e '^$@$$' |\ | |
xargs |
OlderNewer