Skip to content

Instantly share code, notes, and snippets.

@tarao
tarao / uim.rb
Last active March 14, 2017 14:44
#!/usr/bin/env ruby
require 'fiddle/import'
require 'shellwords'
Libuim = `/sbin/ldconfig -p`.split(/[\r\n]/).map do |line|
line.strip.split(/\s+/)[0]
end.find do |line|
line =~ /\Alibuim[.]so[.][0-9]+\z/
end
(require 'evil)
(setq elscreen-tab-display-control nil
elscreen-tab-display-kill-screen nil)
(require 'elscreen)
(evil-define-command evil-tab-new ()
:repeat nil
(setq count (or count 1))
(when (null (elscreen-get-frame-confs (selected-frame)))
(elscreen-start))
map J <C-d>
map K <C-u>
map j 3j
map k 3k
map d D
map ; :
iunmap <C-Enter>
// Configuration
var WEBHOOK_URL = PropertiesService.getScriptProperties().getProperty('webhook_url');
if (!WEBHOOK_URL) throw 'You should set "webhook_url" property from [File] > [Project properties] > [Script properties]';
var SLACK_USERNAME = PropertiesService.getScriptProperties().getProperty('slack_username') || 'cronsheet';
var SLACK_ICON_EMOJI = PropertiesService.getScriptProperties().getProperty('slack_icon_emoji') || ':clock3:';
var SHEET_NAME = PropertiesService.getScriptProperties().getProperty('sheet_name');
// ... END Configuration
var COLUMN_QUARTER = 1;
var COLUMN_DOW = 2;
@tarao
tarao / hotplug.sh
Last active December 19, 2015 15:59
#!/bin/sh
# /usr/local/sbin/hotplug
# sysctl -w kernel.hotplug=/usr/local/sbin/hotplug
dir=/usr/local/etc/hotplug
for script in `ls -1 "$dir"/*`; do
[ -x "$script" ] && ( "$script" >/dev/null 2>&1 ) &
done
#!/bin/sh
# /etc/libvirt/hooks/daemon
net="default"
pidfile="/var/run/libvirt/network/$net.pid"
dnsmasq="/usr/sbin/dnsmasq"
config="/var/lib/libvirt/dnsmasq/$net.conf"
case $2 in
start)
@tarao
tarao / anything-git-project.el
Last active December 16, 2015 02:09
This file is obsolete. Use anything-git-files.el https://github.com/tarao/anything-git-files-el
;; http://shibayu36.hatenablog.com/entry/2012/12/22/135157
(eval-when-compile (require 'cl))
;;;###autoload
(defun anything-git-project-project-dir ()
(let ((dir (shell-command-to-string "git rev-parse --show-toplevel")))
(replace-regexp-in-string "[\n\r]+$" "" dir)))
;;;###autoload
@tarao
tarao / gist:5182203
Last active December 15, 2015 01:48
// http://blog.livedoor.jp/dankogai/archives/51859373.html
var x = { a: 1, b: 2, c: 3 };
var y = { a: 1, b: 2, c: 3, d: 4 };
var z = {a: 1, b: 2, c: 3 };
var w = {a: 1, b: 2, c: 3, d: 4 };
x.b = w;
y.b = x;
z.b = y;
w.b = x;
// ==UserScript==
// @name hatena-bookmark-lower-thumbnail
// @namespace orednu.org
// @include http://b.hatena.ne.jp/*
// @version 1
// ==/UserScript==
(function(w, d) {
w.addEventListener('load', function () {
var getElementsByTagAndClassName = function(element, tag, klass) {