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
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 8, 2024 14:54
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@paulirish
paulirish / what-forces-layout.md
Last active May 9, 2024 07:00
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@anaisbetts
anaisbetts / analytics.js
Created January 7, 2015 20:47
Google Analytics in Atom Shell
// Pretend that cookies work
(function (document) {
var cookies = {};
document.__defineGetter__('cookie', function () {
var output = [];
for (var cookieName in cookies) {
output.push(cookieName + "=" + cookies[cookieName]);
}
return output.join(";");
});
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"
@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 ?

@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.
@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.

@EragonJ
EragonJ / FED-tools.markdown
Created March 10, 2013 14:57
Some useful stuffs for daily use in FED
@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'