This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 最近の行儀のよい JavaScript の書き方 | |
// http://qiita.com/kaiinui/items/22a75d2adc56a40da7b7 | |
(function(global) { | |
"use strict;" | |
// Your Module | |
function YourModule() { | |
// ... | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:alert(document.title + ' ' + location.href); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"links": { | |
"pixi.js" : { "url": "https://github.com/GoodBoyDigital/pixi.js" }, | |
"enchant.js": { "url": "https://raw.github.com/uei/enchant.js-builds/master/build/enchant.js", "memo": "pre-build" } | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global process: false */ | |
var logger = (function(){ | |
var COLOR = { | |
RED: '\u001b[31m', | |
RESET: '\u001b[0m' | |
}; | |
return { | |
log: function(){ console.log.apply(console, arguments); }, | |
error: function() { | |
arguments[0] = COLOR.RED + arguments[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getRolledThicklyDirection = function(year) { | |
var directions = [ | |
"西南西微西", | |
"南南東微南", | |
"北北西微北", | |
"南南東微南", | |
"東北東微東" | |
]; | |
return directions[year % 5]; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent intent = new Intent(); | |
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); | |
intent.setData(Uri.parse("package:com.your.app")); | |
startActivity(intent); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"100": "Continue", | |
"101": "Switching Protocols", | |
"102": "Processing", | |
"200": "OK", | |
"201": "Created", | |
"202": "Accepted", | |
"203": "Non-Authoritative Information", | |
"204": "No Content", | |
"205": "Reset Content", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loadFromFile = function(file, callback) { | |
if(!file || file.trim().length == 0) { | |
callback('file not found', null); | |
return; | |
} | |
callback(null, ("" + require('fs').readFileSync(file))); | |
}; | |
var loadFromPipe = function(callback) { | |
var text = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var zerofill = function(num, zeros) { return (Array(zeros).join('0') + num).slice(-zeros); }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var replaceAll = function(org, before, after){ return org.split(before).join(after); }; |