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
addEventListener("fetch", (event) => { | |
event.respondWith( | |
handleRequest(event.request).catch( | |
(err) => new Response(err.stack, { status: 500 }) | |
) | |
); | |
}); | |
async function handleRequest(request) { | |
console.log(`${request.method} ${request.url}`) |
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
#!/bin/bash | |
[[ $UID == 0 ]] || { echo "run as sudo to install"; exit 1; } | |
if ! [ -x "$(command -v jq)" ]; then | |
echo 'Error: jq is not installed.' >&2 | |
apt install jq -y | |
fi | |
REPO="https://github.com/BurntSushi/ripgrep/releases/download/" | |
RG_LATEST=$(curl -sSL "https://api.github.com/repos/BurntSushi/ripgrep/releases/latest" | jq --raw-output .tag_name) |
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
// Credit to Douglas Crockford for this bind method | |
if (!Function.prototype.bind) { // 如果不存在 bind 方法 | |
Function.prototype.bind = function (oThis) { | |
if (typeof this !== "function") { // bind 方法的调用对象只能是函数,如果不是则抛出异常 | |
// closest thing possible to the ECMAScript 5 internal IsCallable function | |
throw new TypeError ("Function.prototype.bind - what is trying to be bound is not callable"); | |
} | |
var aArgs = Array.prototype.slice.call (arguments, 1), // 浅复制 bind 的参数,从第 2 个开始到结束 http://stackoverflow.com/a/26618338/5657916 | |
fToBind = this, |
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
AZHU.storage = { | |
save : function(key, jsonData, expirationMin){ | |
if (!Modernizr.localstorage){return false;} | |
var expirationMS = expirationMin * 60 * 1000; | |
var record = {value: JSON.stringify(jsonData), timestamp: new Date().getTime() + expirationMS} | |
localStorage.setItem(key, JSON.stringify(record)); | |
return jsonData; | |
}, | |
load : function(key){ | |
if (!Modernizr.localstorage){return false;} |
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
# Ubuntu | |
# OSX |
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
#!/bin/bash | |
# Sample usage is as follows; | |
# ./signapk myapp.apk debug.keystore android androiddebugkey | |
# | |
# param1, APK file: Calculator_debug.apk | |
# param2, keystore location: ~/.android/debug.keystore | |
# param3, key storepass: android | |
# param4, key alias: androiddebugkey | |
USER_HOME=$(eval echo ~${SUDO_USER}) |
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
#!/bin/bash | |
################################### | |
# Usage: sudo ./installer.sh [os] # | |
################################### | |
OS=$1; | |
UBUNTU=""; | |
############# |
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
@charset "utf-8"; | |
/* ----- twicli.css ----- */ | |
/* | |
twicli用CSS Elsewhither(http://else.jimdo.com/others/storage/)をベースに、 | |
Old Twitterになんとなく似せる感じ | |
*/ | |
@import url('//cdn.bootcss.com/font-awesome/4.4.0/css/font-awesome.min.css'); | |
* { |
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
@charset "UTF-8"; | |
/* アイコンフォント読み込み */ | |
@import url('//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'); | |
/** | |
* 全体 | |
*/ | |
* { | |
outline: none; |
NewerOlder