Skip to content

Instantly share code, notes, and snippets.

View addityasingh's full-sized avatar
💻
Focusing

Aditya Pratap Singh addityasingh

💻
Focusing
View GitHub Profile
@addityasingh
addityasingh / callback-hoisting.js
Created April 10, 2016 20:21
In JavaScript, are named callback functions hoisted?
function enclosingScope () {
var b;
function inner (def) {
def();
}
var a = 2;
}
// After hoisting due to compilation, the above changes to
@addityasingh
addityasingh / try-catch-block-scope.js
Last active April 10, 2016 19:44
Try catch do not introduce block scope for new declarations
(function () {
'use strict';
try {
undefined();
} catch (err) {
var a = 5;
console.log(a); // 5
console.log(err); // TypeError: undefined is not a function(…)
}
@addityasingh
addityasingh / build-ios.sh
Last active April 1, 2016 21:07
Setup phonegap-push-plugin for ionic app
$PATH_TO_PROVISIONING_PROFILE = ""
$DEVELOPER_TEAM_ID = ""
xcodebuild PROVISIONING_PROFILE="$PATH_TO_PROVISIONING_PROFILE" CODE_SIGN_IDENTITY="$DEVELOPER_TEAM_ID"