Skip to content

Instantly share code, notes, and snippets.

View EragonJ's full-sized avatar
🇯🇵
Learning Japanese

Ryu | Chia-Lung Chen EragonJ

🇯🇵
Learning Japanese
View GitHub Profile
@pushmatrix
pushmatrix / gist:4035423
Created November 7, 2012 23:44
Testing out whether V8 within Chrome runs garbage collection on global variables (assigned to window)
<script>
function logMemory() { console.log("Heap use(MB): " + window.performance.memory.usedJSHeapSize / 1000000, ", Total heap size(MB): " + window.performance.memory.totalJSHeapSize / 1000000) };
window.things = {};
things.array = [];
function leak() {
for(var i = 0; i < 5000000; i++) {
things.array.push("test string");
}
}
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

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

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

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

作者 c9s (Cornelius) 看板 IronSea
標題 [符] Perl 常用模組
時間 Mon Mar 8 16:16:43 2010
───────────────────────────────────────
Plack
PSGI toolkit and server adapters
see: http://github.com/miyagawa/Plack
@alanjrogers
alanjrogers / UIImageView+CATransition.m
Created November 11, 2010 03:00
Sample code showing how to add a CATransition to changing the image on a UIImageView
UIImage* newImage = [UIImage imageNamed:context];
// set up an animation for the transition the content
CATransition *animation = [CATransition animation];
[animation setDuration:0.25];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromRight];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[[self.contentImageView layer] addAnimation:animation forKey:@"SwitchToView1"];