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
{ | |
"name": "some-package", | |
"dependencies": { | |
"uglifyjs": "^2.0", | |
"grunt": "*", | |
"grunt-cli": "*", | |
"grunt-contrib-uglify": "*" | |
}, | |
"scripts": { | |
"prepublish": "test -f $PWD/node_modules/.bin/uglifyjs || (rm -f $PWD/node_modules/.bin/uglifyjs && ln -s $PWD/node_modules/grunt-contrib-uglify/node_modules/.bin/uglifyjs $PWD/node_modules/.bin/uglifyjs)" |
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
> Object() | |
{} | |
> Object() == {} | |
false | |
> Object() == new Object() | |
false | |
> {} == new Object() | |
false |
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
macro if_t { | |
case { _ $v } => { | |
letstx $vv = [makeValue(#{$v}.map(unwrapSyntax).join(''), #{here})] | |
return #{$vv} | |
} | |
} | |
macroclass iclass { | |
pattern { | |
rule { $type:if_t $vn:if_t } |
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
option '-f', '--file [FILE]', 'File to cover' | |
task 'coverage:methods', 'Returns methods defined in given file', (opts) -> | |
[fs, regex] = [ | |
require 'fs' | |
new RegExp '([\\w\\.\\_]+)?\\s*?\\=\\s*?function\\(', 'gm' | |
] | |
if not opts.file? | |
util.error 'no file specified', 'coverage' | |
return |
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
watchConfig: true | |
ports: | |
80: | |
router: | |
'github.com': 'github.com:80' | |
443: | |
router: | |
'github.com': 'github.com:443' |
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
//growlnotify -n "My App" -m "Hello world" | |
//osascript -e 'display notification "Lorem ipsum dolor sit amet" with title "Title"' | |
//os.platform` | |
var _notify = function(taskName, msg) { | |
var _child; | |
if (taskName == void(0) || taskName === null || taskName.length === 0) { | |
if (this.name != void(0)) { | |
taskName = this.name; | |
} else { |
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 Logger(loggerName) { | |
this.loggerName = loggerName || 'logger'; | |
this.date = new Date; | |
} | |
(function (prototype) { | |
prototype.time = function () { | |
var time = [ | |
this.date.getHours(), | |
this.date.getMinutes(), |
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
// Intercepting HTTP calls with AngularJS. | |
angular.module('MyApp', []) | |
.config(function ($provide, $httpProvider) { | |
// Intercept http calls. | |
$provide.factory('MyHttpInterceptor', function ($q) { | |
return { | |
// On request success | |
request: function (config) { | |
// console.log(config); // Contains the data about the request before it is sent. |
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
Vagrant.configure(2) do |config| | |
config.vm.define "boot2docker" | |
config.vm.box = "parallels/boot2docker" | |
config.vm.box_check_update = false | |
config.ssh.private_key_path = [ | |
'~/.vagrant.d/insecure_private_key', | |
'~/.ssh/id_rsa' | |
] |
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
// Tests: http://jsfiddle.net/yumitsu/k18fkfgt/ | |
var MobileDevice = { | |
init: function() { | |
var j, device, _this = this; | |
device = { | |
'mobile': _this.isMobileDevice(), | |
'mobileDimensions': _this.isDimsMatching(), | |
'webkit': _this.isWebKitDevice(), | |
'mobileSafari': _this.isMobileSafari(), |