Skip to content

Instantly share code, notes, and snippets.

Avatar

teramako teramako

View GitHub Profile
@teramako
teramako / cmds.yml
Created Dec 19, 2020
ansible-playbook simple_cmds.yml -e @cmds.yml
View cmds.yml
## this is sample
COMMANDS:
- |
id
uname -n
date
- cat /path/to/file
ADMIN: true
@teramako
teramako / config.json
Last active Sep 13, 2020
pecoで ls -l の結果からファイル名部分のみを検索できるようにCustomFilterを設定
View config.json
{
"CustomFilter": {
"ls-l": {
"Cmd": "perl",
"Args": ["/Users/teramako/bin/ls-l-filter.pl", "$QUERY"],
"BufferThreshold": 100
}
}
}
@teramako
teramako / extendGeneratorPrototype.js
Last active Sep 18, 2016
Generatorのプロトタイプ拡張。ま、やっつけです。
View extendGeneratorPrototype.js
/* Usage
function * gene() {
console.log("iter");
yield 1;
console.log("iter");
yield 2;
console.log("iter");
yield 3;
}
var result = gene
@teramako
teramako / join.vba
Created Jun 27, 2016
Excel VBAの標準モジュールに追加してる関数
View join.vba
' ="SELECT ..... FROM ... WHERE column_A in ("&join(A1:A10,",","'")&")" などと式に使うことを想定
' SQLインジェクション可能だが知らん。
Function join(r As Range, Optional delimiter As String = ",", Optional wrap As String = "'") As String
Dim i As Integer
Dim result = As String
result = wrap & r.Cells(1, 1).Value & wrap
For i = 2 To r.rows.Count
@teramako
teramako / gist:a076cedcaebcc70252bf
Last active Aug 29, 2015
今日ダウンロードしたzipファイル。
View gist:a076cedcaebcc70252bf
$ file HOGEHOGE.zip
HOGEHOGE.zip: Bourne-Again shell script text executable
$ strings HOGEHOGE.zip
#!/bin/bash
sed -e '1,/BIGIN HOGEHOGE/d' $0 |sed -e '1,/BIGIN HOGEHOGE/d' > ./test.tar.gz
tar zxvf test.tar.gz >/dev/null;
chown root aFile bFile cFile
chmod 4755 aFile bFile cFile
exit 0
#BIGIN HOGEHOGE
View es6_quiz_answer.md

ECMAScript6th Quiz Answer

Answer of ES6 Quiz

A.1

  • 2 "func"

see: [9.2.12 SetFunctionName][9.2.12], [12.14.4 Runtime Semantics of AssignmentExpression][12.14.4]

View ES6_quiz.md

ECMAScript6th Quiz

Q.1

let func = function() {};
func.name
  1. ""
  2. "func"
@teramako
teramako / list_found.js
Created Jan 19, 2015
Vimperator プラグイン。<Leader>/ でページ内検索した時にリストを作成して foundlist コマンドで該当箇所にジャンプする。
View list_found.js
var wm = new WeakMap;
mappings.addUserMap([modes.NORMAL], ["<Leader>/"], "Search forward for a pattern", function () { openPrompt(modes.SEARCH_FORWARD); });
commands.addUserCommand(['foundlist', 'fl'], 'show found list',
function (args) {
var index = parseInt(args.literalArg, 10);
if (Number.isNaN(index))
return;
@teramako
teramako / fix_mime_desc.patch
Created Mar 23, 2014
Mac の QuickTime プラグイン部分(about:addons と about:plugins)が文字化けしているので修正するパッチ
View fix_mime_desc.patch
# HG changeset patch
# Parent 573ef29c7a9f67205f71527db56d7f32500feffc
diff -r 573ef29c7a9f toolkit/mozapps/extensions/internal/PluginProvider.jsm
--- a/toolkit/mozapps/extensions/internal/PluginProvider.jsm Sat Mar 22 08:07:42 2014 -0700
+++ b/toolkit/mozapps/extensions/internal/PluginProvider.jsm Sun Mar 23 09:19:00 2014 +0900
@@ -408,7 +408,7 @@
for (let i = 0; i < mimeTypes.length; i++) {
let type = {};
type.type = mimeTypes[i];
@teramako
teramako / df.cmd
Last active Aug 29, 2015
Windows でディスク使用率等の一覧を表示する
View df.cmd
@if(0)==(0) ECHO OFF
CScript //NoLogo //E:JScript "%~f0" %*
GOTO :EOF
@end
var COLUMN_INFOs = {
k: {
drive: { width: 5, align: "left" },
type: { width: 4, align: "left" },
total: { width: 14, align: "right" },