Skip to content

Instantly share code, notes, and snippets.

@adowning
Last active February 12, 2016 20:41
Show Gist options
  • Select an option

  • Save adowning/65ae86e93a613a67119e to your computer and use it in GitHub Desktop.

Select an option

Save adowning/65ae86e93a613a67119e to your computer and use it in GitHub Desktop.
webstorm live templates
clog
console.log('$PARAM$ ' + $END$);
fbget
var ref = new Firebase(FURL + 'jobs');
ref.once("value", function (snapshot) {
snapshot.forEach(function (childSnapshot) {
var key = childSnapshot.key();
var childData = childSnapshot.val();
if (json.items[0].orderNumber == childData.orderNumber) {
}
});
});
ajax
$.ajax({
type: "GET",
url: "https://api.servicemonster.net/v1/orders?q=" + job.id,
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (error) {
console.log(error)
},
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Basic ZTZleGc0Nkw6bUM0RHM5MXFnZXdPUzFv");
},
complete: function (json) {
},
success: function (json) {
}
});
for - Loop 'for' with index
len = $ARRAY$.length;
for ($INDEX$ = 0; $INDEX$<len; $INDEX$ += 1) {
$VAR$ = $ARRAY$[$INDEX$];
$END$
}
ife - 'if-else' statement
if ($CONDITION$) {
$END$
} else {
}
try - 'try-catch' statement
try {
$END$
} catch (err) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment