- 特定のスプレッドシートだけを外から更新したい
- OAuth は大変めんどうかつ、特定のスプレッドシートのみ権限を与えることができない
- Google Spread Sheet の XML API が全力で面倒
- いじりたいスプレッドシートで [ツール] → [スクリプトエディタ…] を開く (Google ドライブの新規作成から、スクリプトを選んでもいい)
- スクリプトエディタに code.gs の内容をはっつける。
//#!node | |
const sleep = (n) => new Promise( (resolve) => setTimeout(resolve, n) ); | |
const asciichart = require('asciichart') | |
const screen = { | |
clear: function () { | |
console.log('\x1b[2J'); | |
}, |
// Eg.: http://cho45.github.com/tasscss/ | |
(function () { | |
var scripts = document.getElementsByTagName('script'); | |
var script = scripts[scripts.length-1]; | |
var container = document.createElement('div'); | |
script.parentNode.insertBefore(container, script); | |
var callback; do { | |
callback = 'jsonp' + Math.floor(Math.random() * 0xffff); |
function formatN (n) { | |
const unitList = ['y', 'z', 'a', 'f', 'p', 'n', 'u', 'm', '', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']; | |
const zeroIndex = 8; | |
const nn = n.toExponential(2).split(/e/); | |
let u = Math.floor(+nn[1] / 3) + zeroIndex; | |
if (u > unitList.length - 1) { | |
u = unitList.length - 1; | |
} else | |
if (u < 0) { | |
u = 0; |
if (typeof uneval != "function") { | |
uneval = function (o) { | |
switch (typeof o) { | |
case "undefined" : return "(void 0)"; | |
case "boolean" : return String(o); | |
case "number" : return String(o); | |
case "string" : return '"' + o.replace(/[^a-z]/gi, function (_) { return '\\u' + (0x10000 + _.charCodeAt(0)).toString(16).slice(1) }) + '"'; | |
case "function" : return "(" + o.toString() + ")"; | |
case "object" : | |
if (o == null) return "null"; |
document.body.textContent = new Date().getTime(); |
#!/usr/bin/xcrun swift | |
import Cocoa | |
struct ProgramOption { | |
var list : Bool = false | |
var set : String? = nil | |
var help : Bool = false | |
} |
function parseIRCMessage (text) { | |
var fg = 0; | |
var bg = 0; | |
var fl = 0; | |
var ss = text.split(parseIRCMessage.re); | |
var ret = []; | |
var state = {}; | |
for (var i = 0, len = ss.length; i < len; i++) { | |
text = ss[i]; | |
if (!text) continue; |
// ==UserScript== | |
// @name Hatena::Diary: for writing | |
// @namespace http://lowreal.net/ | |
// @include http://d.hatena.ne.jp/*gihyo/* | |
// @require https://gist.github.com/3239.txt#createElementFromString | |
// @require https://gist.github.com/3238.txt#$X | |
// @require https://github.com/cho45/jsdeferred/raw/master/jsdeferred.userscript.js | |
// ==/UserScript== | |
// つかいかた: | |
// |
=pod | |
Nyan Cat TAP Formatter | |
1. Save this file into your PERL5LIB | |
2. Run prove with option like following: | |
$ prove --formatter NyanCat | |
http://www.mattsears.com/articles/2011/11/16/nyan-cat-rspec-formatter |