I hereby claim:
- I am schnogz on github.
- I am schnogz (https://keybase.io/schnogz) on keybase.
- I have a public key ASAjhp1sVkgvmYvM0FWlF1ypj2RFzShmRq2NO4xz2k0_Ego
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| files: | |
| "/opt/elasticbeanstalk/hooks/appdeploy/post/00_set_tmp_permissions.sh": | |
| mode: "000755" | |
| owner: root | |
| group: root | |
| content: | | |
| #!/usr/bin/env bash | |
| chown -R nodejs:nodejs /tmp/.npm |
| { | |
| "directory": "public/bower_modules/" | |
| } |
| // create a closure and remap jQuery to $ | |
| (function($){ | |
| // save off original method | |
| var _originalAppendTo = $.fn.appendTo; | |
| // override method | |
| $.fn.appendTo = function() { | |
| // silly code to alternate backgound color | |
| if ($(document.body).children().length % 2) { | |
| document.body.style.background = "#f285cf"; |
| function Dog (name, breed) { | |
| // instance variables | |
| this.name = name; | |
| this.breed = breed; | |
| var medicalRecords = { | |
| "hasWorms": true, | |
| "hasDiabetes": false | |
| }; | |
| ====================================================== | |
| // The magnitude of this hack compares favorably with that of the US national debt. | |
| ====================================================== | |
| // Warning: Thar be dragons lurkin and black magic at work here. | |
| // Modify at your own risk! | |
| // | |
| // ^ ^ |
| // The following results in a syntax error. | |
| var a = 'a' | |
| [].forEach.call(document.querySelectorAll('.md'), function(e) { | |
| console.log(e); | |
| }); | |
| // Adding the semicolon and now everything works just fine. | |
| var a = 'a'; | |
| [].forEach.call(document.querySelectorAll('.md'), function(e) { | |
| console.log(e); |
| define([ | |
| 'text!./Templates/mainTemplate.html', | |
| 'text!./Templates/messageTemplate.html' | |
| ], function ( | |
| maintemplate, | |
| messageTemplate | |
| ) { | |
| 'use strict'; | |
| function Animal(hasFeathers, sound) { | |
| this.hasFeathers = hasFeathers; | |
| this.sound = sound; | |
| } | |
| Animal.prototype.isDuck = function() { | |
| if (this.hasFeathers && this.sound === "Quack") { | |
| console.log("I am a duck"); | |
| } else { | |
| console.log("I am not a duck"); | |
| } |
| // Attempt #1: using typeof | |
| // fails in all cases since typeof [] returns "object" | |
| Array.prototype.isArray = function(obj) { | |
| return (typeof obj === "array"); | |
| } | |
| // Attempt #2: using instanceof | |
| // fails when obj = Array.prototype | |
| // and when array is defined in another window or frame | |
| Array.prototype.isArray = function(obj) { |