$ mkdir -p ~/Library/Application\ Support/TextMate/Bundles
$ cd !$
$ svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/
$ osascript -e 'tell app "TextMate" to reload bundles'
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
/// To use reduce() to sum a sequence, we need | |
/// | |
/// - a zero (identity) element | |
/// - an addition operator | |
protocol Summable { | |
/// Identity element for this type and the + operation. | |
static var Zero: Self { get } |
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
// | |
// Demonstration of using a channel to receive and dispatch IOHIDManager events using the ChannelZ framework. | |
// | |
// Created by Marc Prud'hommeaux on 3/8/15. | |
// | |
import Cocoa | |
import IOKit | |
import ChannelZ | |
@NSApplicationMain |
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
// Is the passed CSS property supported? | |
// eg. detectCSS('transition') | |
function detectCSS(prop){ | |
var | |
prop = prop.replace(/-(\w)/g,function(s,g){return g.toUpperCase()}), | |
pre = ',Icab,Khtml,Moz,Ms,O,Webkit'.split(','); | |
for (var i = 0; i < pre.length; ++i){ | |
if(i==1) | |
prop = prop.slice(0,1).toUpperCase() + prop.slice(1); |
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
var app = angular.module('yourApp'); | |
app.directive("parentDirective", function(){ | |
return { | |
restrict: "A", | |
controller:function(){ | |
this.test = function(){ | |
console.log("parentController - okay"); | |
} | |
} | |
}; |
Adds the js-signals implementation to AngularJS. There is no good way for AngularJS services to send or receive events. The 'angular way' for events to be sent uses $rootScope, but angular services should never know about any scope. Enter SignalTowerService and it's publish/subscribe model of Signals ala js-signals
A Pen by Keldon Rush on CodePen.
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
/* | |
ericasadun.com | |
Sometimes letting go doesn't mean saying goodbye | |
*/ | |
prefix operator ++ | |
prefix operator -- | |
postfix operator ++ |
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
import Foundation | |
// Tuple result | |
// Get contents of directory at specified path, returning (filenames, nil) or (nil, error) | |
func contentsOfDirectoryAtPath(path: String) -> (filenames: String[]?, error: NSError?) { | |
var error: NSError? = nil | |
let fileManager = NSFileManager.defaultManager() | |
let contents = fileManager.contentsOfDirectoryAtPath(path, error: &error) |
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
deploy: | |
rm -rf ./build | |
wintersmith build | |
cd ./build && \ | |
git init . && \ | |
git add . && \ | |
git commit -m "Deploy"; \ | |
git push "git@github.com:{YOUR NAME}/{YOUR REPO}.git" master:gh-pages --force && \ | |
rm -rf .git |