This file contains hidden or 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 {DomEventsPlugin} from 'angular2/platform/common_dom'; | |
// Have to pull DOM from src because platform/common_dom returns DOM as null. | |
// I believe its a TS bug. | |
import {DOM} from 'angular2/src/platform/dom/dom_adapter'; | |
import {Injectable} from 'angular2/core'; | |
import {noop} from 'angular2/src/facade/lang'; | |
@Injectable() | |
export class DOMOutsideEventPlugin extends DomEventsPlugin { | |
eventMap: Object = { |
This file contains hidden or 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 five = require("johnny-five"), | |
TesselIO = require("tessel-io"), | |
board = new five.Board({ | |
io: new TesselIO() | |
}); | |
// Initial Red color to start with. | |
// Decent transitions are easier with RGB vs HEX. | |
var startingColorObject = { | |
r: 255, |
This file contains hidden or 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 webpackUniversalModuleDefinition(root, factory) { | |
if(typeof exports === 'object' && typeof module === 'object') | |
module.exports = factory(); | |
else if(typeof define === 'function' && define.amd) | |
define([], factory); | |
else if(typeof exports === 'object') | |
exports["fun"] = factory(); | |
else | |
root["fun"] = factory(); | |
})(this, function() { |
This file contains hidden or 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
module.exports = function convertES6StyleAndHTMLImportsToTypeScriptFriendlyRequires(source) { | |
this.cacheable && this.cacheable(); | |
var hasES6StyleAndHTMLImportRegex = new RegExp(/import\s+(.+)\s+from\s+([\'|\"].+\.(html|jade|haml|twig|erb|css|scss|less|yaml|sass|styl)[\'\"]);?/, 'g'); | |
var results; | |
try { | |
results = source.replace(hasES6StyleAndHTMLImportRegex, | |
"let $1 = require($2);\n" | |
); |
This file contains hidden or 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
$scope.$watch( | |
function () { return obj.hasOwnProperty("choice") }, | |
function (newLocation, oldLocation) { | |
//Do things here. | |
} | |
); | |
This file contains hidden or 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 () { | |
var root = angular.element(document.getElementsByTagName('body')); | |
var watchers = []; | |
var f = function (element) { | |
angular.forEach(['$scope', '$isolateScope'], function (scopeProperty) { | |
if (element.data() && element.data().hasOwnProperty(scopeProperty)) { | |
angular.forEach(element.data()[scopeProperty].$$watchers, function (watcher) { | |
watchers.push(watcher); |
This file contains hidden or 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
<script type="text/ng-template" id="one.html"> | |
<div>This is first template</div> | |
</script> | |
<script type="text/ng-template" id="two.html"> | |
<div>This is second template</div> | |
</script> |
This file contains hidden or 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
+(WebViewPopup*)sharedWebViewPopup | |
{ | |
static dispatch_once_t once; | |
static WebViewPopup* sharedWebViewPopup; | |
dispatch_once(&once, ^{ | |
sharedWebViewPopup = [[WebViewPopup alloc] init]; | |
}); | |
return sharedWebViewPopup; | |
} |
This file contains hidden or 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
sean:tt_project_tracker_api_beta sean$ ruby app.rb | |
== Sinatra/1.4.4 has taken the stage on 80 for development with backup from Thin | |
>> Thin web server (v1.5.1 codename Straight Razor) | |
>> Maximum connections set to 1024 | |
>> Listening on localhost:80, CTRL+C to stop | |
>> Stopping ... | |
== Sinatra has ended his set (crowd applauds) | |
/Users/sean/.rvm/gems/ruby-2.1.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError) | |
from /Users/sean/.rvm/gems/ruby-2.1.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_server' | |
from /Users/sean/.rvm/gems/ruby-2.1.0/gems/thin-1.5.1/lib/thin/backends/tcp_server.rb:16:in `connect' |
This file contains hidden or 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
sean:tt_project_tracker_api_beta sean$ gem env | |
RubyGems Environment: | |
- RUBYGEMS VERSION: 2.2.1 | |
- RUBY VERSION: 2.1.0 (2013-12-25 patchlevel 0) [x86_64-darwin12.0] | |
- INSTALLATION DIRECTORY: /Users/sean/.rvm/gems/ruby-2.1.0 | |
- RUBY EXECUTABLE: /Users/sean/.rvm/rubies/ruby-2.1.0/bin/ruby | |
- EXECUTABLE DIRECTORY: /Users/sean/.rvm/gems/ruby-2.1.0/bin | |
- SPEC CACHE DIRECTORY: /Users/sean/.gem/specs | |
- RUBYGEMS PLATFORMS: | |
- ruby |