Skip to content

Instantly share code, notes, and snippets.

View nathanboktae's full-sized avatar

Nathan Black nathanboktae

View GitHub Profile
body .container {
padding: 0 15px;
}
body .container {
width: 100%;
}
body .container .repo-container, body .new-issue-form {
display: flex;
@nathanboktae
nathanboktae / merge-sort.js
Created October 4, 2015 18:40
JavaScript merge sort in 30 lines that's only 10% slower than native in V8 - http://jsperf.com/merge-sort/3
if (!Array.prototype.mergeSort) {
Array.prototype.mergeSort = function(predicate) {
if (this.length < 2) return this
var middle = Math.round(this.length / 2),
left = this.slice(0, middle).mergeSort(predicate),
right = this.slice(middle, this.length).mergeSort(predicate),
merged = [], leftCursor = 0, rightCursor = 0,
predicate = predicate || function(a, b) { return a <= b ? -1 : 1 }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>sql</string>
<string>pgsql</string>
<string>psql</string>
</array>
@nathanboktae
nathanboktae / ko-es5.js
Last active October 13, 2015 23:47
Knockout observables with ECMAScript 5 Properties - now at https://github.com/nathanboktae/knockout-es5-option4
(function(factory, global) {
if (global.define && global.define.amd) {
global.define(['ko'], factory);
} else {
factory(global.ko);
}
})(function(ko) {
var deepObservifyArray = function(arr, deep) {
for (var i = 0, len = arr.length; i < len; i++) {
@nathanboktae
nathanboktae / ko-signals.js
Created December 1, 2012 20:24
Use ko.subscribable in place of js-signals when using crossroads.js
(function(factory, global) {
if (global.define && global.define.amd) {
global.define(['ko'], factory);
} else {
global.signals = factory(global.ko);
}
})(function(ko) {
return {
Signal: function() {
var sub = new ko.subscribable();