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
@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"];
作者 c9s (Cornelius) 看板 IronSea
標題 [符] Perl 常用模組
時間 Mon Mar 8 16:16:43 2010
───────────────────────────────────────
Plack
PSGI toolkit and server adapters
see: http://github.com/miyagawa/Plack
@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:

@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");
}
}
@EragonJ
EragonJ / gist:4975103
Created February 18, 2013 04:16
use ack to search matched keywords and replaced by one-line perl
ack -l 'YOUR_KEYWORDS' | xargs perl -pi -E 's/YOUR_KEYWORDS/REPLACED_WORDS/g'
@EragonJ
EragonJ / FED-tools.markdown
Created March 10, 2013 14:57
Some useful stuffs for daily use in FED
@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@jmar777
jmar777 / debugging-node-elastic-beanstalk-woes
Created February 28, 2014 22:32
Debugging "Failed to run npm install. Snapshot logs for more details." on Elastic Beanstalk
First, we need to figure out what the actual error is. This is obviously frustrating given that the error message is intentionally truncating it.
1) SSH in to your node (various guides available for this if you're not already familiar with this).
2) Run this command (basically an Elastic Beanstalk wrapper command for npm install I found in a blog post [1]):
$ sudo /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install 2
3) Find the actual error message in the output from the npm install.
Once you know the error, it should hopefully be fairly obvious how to fix it. I've run into two different errors over the last couple days on Elastic Beanstalk:
The first was a dependency that was using the new "^X.Y.Z" version syntax, which is only supported in Node >= v0.10.26 (whereas Elastic Beanstalk only supports up to v0.10.21 as of today). The solution here was easy: hardcode a dependency version *prior* to when that dependency adopted to the new syntax.
@EragonJ
EragonJ / readme.md
Last active August 21, 2019 09:26
Tips you need to know when contributing to Mozilla/Gaia

Why this list ?

There are many times we have contributors who want to contribute to Mozilla/Gaia, but we always would meet some new friends who are not so familiar with our working flows and Git.

In spite of keep telling them how to do that every time, I think it would be better to record screencasts about how to do that step by step. By following these instructions, you can easily jump into the ecosystem of Mozilla without too many obstacles.

Please fasten your seatbelt and let's start to hack :)

How to rebase and fix conflicts ?

adb shell "stop b2g"
adb shell "cd /data/b2g/mozilla/*.default/ && echo 'user_pref(\"devtools.debugger.forbid-certified-apps\", false);' >> prefs.js"
adb shell "start b2g"