Skip to content

Instantly share code, notes, and snippets.

View hongymagic's full-sized avatar
🤪

David Hong hongymagic

🤪
View GitHub Profile
@hongymagic
hongymagic / 0_reuse_code.js
Created January 18, 2014 13:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hongymagic
hongymagic / pr.md
Last active December 15, 2017 09:50 — forked from piscisaureus/pr.md
Checkout pull-requests from Atlassian Stash without adding remote

Locate the section for your stash remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@stash.internal:private/repository.git

Now add the line fetch = +refs/pull-requests/*:refs/remotes/origin/pull-requests/* to this section. Obviously, change the stash url to match your project's URL. It ends up looking like this:

@hongymagic
hongymagic / mask.js
Created June 3, 2012 06:22 — forked from bjouhier/hackGlobal.js
Masking eval, extracting FunctionBody – not really sure where it would be used.
// Extract FunctionBody as eval expects FunctionBody
Function.prototype.getBody = function() {
var m = this.toString().match(/\{([\s\S]*)\}/m)[1];
return m.replace(/^\s*\/\/.*$/mg,'');
};
var GLOBAL = "GLOBAL";
function foo () {