Skip to content

Instantly share code, notes, and snippets.

View motemen's full-sized avatar

Hironao OTSUBO motemen

View GitHub Profile
{
"action": "synchronize",
"number": 2,
"pull_request": {
"url": "https://api.github.com/repos/motemen/test-repository/pulls/2",
"id": 17160832,
"html_url": "https://github.com/motemen/test-repository/pull/2",
"diff_url": "https://github.com/motemen/test-repository/pull/2.diff",
"patch_url": "https://github.com/motemen/test-repository/pull/2.patch",
"issue_url": "https://api.github.com/repos/motemen/test-repository/issues/2",
@motemen
motemen / ghq.sbt
Last active January 26, 2016 10:44
lazy val ghqGetDepndencies = taskKey[Unit]("""Download dependencies using "ghq get".""")
ghqGetDepndencies <<= (ivyPaths, libraryDependencies, streams) map {
(ivyPaths, libraryDependencies, s) =>
new IvyCache(ivyPaths.ivyHome).withDefaultCache(None, s.log) {
cache =>
libraryDependencies.foreach {
m =>
import org.apache.ivy.core.module.id.ModuleRevisionId
import scala.collection.JavaConversions._
watchSources ~= {
_.filterNot {
f =>
f.isDirectory ||
"""^\..*\.sw.$""".r.findFirstIn(f.getName).isDefined
}
}
lazy val ghqGetDepndencies = TaskKey[Unit]("ghq-get-dependencies")
@motemen
motemen / go-vendor.sh
Created July 29, 2015 04:47
Poor man's vendoring script for Go
#!/bin/sh
set -e
vendor_root='_vendor'
cmd_save () {
deps="$(go list -f '{{join .Deps "\n"}}' ./...)"
go list -f '{{if (not .Standard)}}{{.ImportPath}}{{"\t"}}{{.Dir}}{{end}}' $deps | sort \
setlocal path^=lib
setlocal path^=extlib
setlocal path^=t/lib
setlocal path^=modules/*/lib
setlocal path^=modules/*/t/lib
setlocal path^=../../modules/*/lib
setlocal path^=local/lib/perl5
setlocal path^=local/lib/perl5/darwin-2level
setlocal includeexpr=substitute(substitute(v:fname,'^.\\{-}\\([A-Za-z0-9_:]\\+\\)[^A-Za-z0-9_:]*$','\\1.pm',''),'::','/','g')
setlocal suffixesadd=.pm
autoload -U modify-current-argument
autoload -U split-shell-arguments
complete-mackerel-host-ip () {
local apikey=$1
local apikey_name=$2
local mode_append_only=0
local REPLY
local reply
#!/bin/sh
set -e
name=$(node -p -e 'require("./bower.json").name')
out=./gh-pages
rm -rf $out
mkdir -p $out
#!/bin/bash
# anigiflgtmizer
# requires pup <https://github.com/EricChiang/pup>
sites=(
http://gif-chan.tumblr.com/
http://kawaiianimegif.tumblr.com/
)
site=${sites[$(($RANDOM % ${#sites[@]}))]}
$Command = {
New-Service -Name MackerelAgentService -BinaryPathName 'C:\Program Files\Windows Resource Kits\Tools\srvany.exe'
New-Item -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\MackerelAgentService\Parameters'
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\MackerelAgentService\Parameters' -Name Application 'C:\Go\bin\mackerel-agent.exe -conf C:\mackerel-agent\mackerel-agent.conf -root C:\mackerel-agent'
Write-Host '`Start-Service MackerelAgentService` to start service'
}
Start-Process PowerShell -ArgumentList "-NoExit -Command & { $Command }" -Verb RunAs
@motemen
motemen / brew-tesseract-gif.adoc
Created October 3, 2014 15:01
homebrew: tesseract の gif 対応
brew install leptonica

してから

brew install tesseract

する。