Skip to content

Instantly share code, notes, and snippets.

View dwi2's full-sized avatar

Tzu-Lin Huang dwi2

  • Fukuoka, Japan
  • 04:15 (UTC +09:00)
View GitHub Profile
});})(typeof define=='function'&&define.amd?define
:(function(n,w){'use strict';return typeof module=='object'?function(c){
c(require,exports,module);}:function(c,d){c=(typeof c == 'function')?c:d;var m={exports:{}};c(function(n){
return w[n];},m.exports,m);w[n]=m.exports;};})('your_module_name',this));
@begeeben
begeeben / develop.js
Last active August 29, 2015 14:26
A handly script to make and run Firefox OS Gaia. Watch for file changes and make on the fly.
// Usage: node make_onsave.js b2g tv browser
// node make_onsave.js nightly phone settings
// node make_onsave.js simulator tv tv-deck
// node make_onsave.js b2g tv
'use strict';
var fs = require('fs');
var path = require('path');
var exec = require('child_process').exec;
@dwi2
dwi2 / Gaia UI test memo
Last active August 29, 2015 14:05
Gaia UI test memo - How to run Gaia UI test on b2g desktop
## Document ##
* Marionette Client document
http://marionette-client.readthedocs.org/en/latest/#
* Gaia UI Tests doc lists
https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests
@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@jonathantneal
jonathantneal / README.md
Last active November 9, 2023 21:10
createElement.js // a 300 byte DOM Element creator

createElement.js

createElement.js lets document.createElement use CSS selectors.

This is a pretty useful library for building out DOM elements. The whole thing runs on one regex and a for loop, so it’s plenty fast. The script is 300 bytes when compressed and gzipped. For 524 bytes (advanced), it includes nesting support and can generate entire DOM hierarchies, including text nodes.

Usage

document.createElement(); // generates <div />
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>