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
sudo xcode-select -switch /Applications/Xcode-beta.app/Contents/Developer/ |
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
spctl --add /Path/To/Application.app |
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
directive('$directiveName$', function factory($injectables$) { | |
return { | |
// priority: 0, | |
// restrict: 'A', // Attribute (default): <div my-directive="exp"></div> | |
// restrict: 'E', // Element name: <my-directive></my-directive> | |
// restrict: 'C', // Class: <div class="my-directive: exp;"></div> |
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 live = (function () { | |
var eventRegistry = {}; | |
function dispatchEvent(event) { | |
var targetElement = event.target; | |
eventRegistry[event.type].forEach(function (entry) { | |
var potentialElements = document.querySelectorAll(entry.selector); | |
var hasMatch = Array.prototype.indexOf.call(potentialElements, targetElement) >= 0; |
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
directive('lazyHtml', function() { | |
return { | |
transclude: 'element', | |
priority: 1200, | |
terminal: true, | |
restrict: 'A', | |
compile: function(element, attr, linker) { | |
return function ($scope, $element, $attr) { | |
var visible = false; | |
var stopWatching = $scope.$watch($attr.lazyHtml, function(value){ |
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 getXmlHttp(){ | |
var xmlhttp; | |
try { | |
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); | |
} catch (e) { | |
try { | |
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); | |
} catch (E) { | |
xmlhttp = false; | |
} |
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
// Helper function to correctly set up the prototype chain, for subclasses. | |
// Similar to `goog.inherits`, but uses a hash of prototype properties and | |
// class properties to be extended. | |
var extend = function(protoProps, staticProps) { | |
var parent = this; | |
var child; | |
// The constructor function for the new subclass is either defined by you | |
// (the "constructor" property in your `extend` definition), or defaulted | |
// by us to simply call the parent's constructor. |
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
app = angular.module 'myapp', [] | |
# simple class exemple - minification safe | |
class MySimpleCtrl | |
@$inject: ['$scope'] | |
constructor: (@scope) -> | |
# attach viewmodel data to the scope: | |
@scope.demo = 'Simple class demo' | |
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 should = require('chai').should(); | |
db.get(1234, function (err, doc) { | |
should.not.exist(err); | |
should.exist(doc); | |
doc.should.be.an('object'); | |
}); |
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
// Don't care much about inheritance at this point, but I'll probably attempt it at | |
// some point via cloning ancestor schema's | |
var mongoose = require('mongoose'), | |
Schema = mongoose.Schema; | |
var Contact = new Schema({ | |
_type: String, | |
name: String | |
}); |