Skip to content

Instantly share code, notes, and snippets.

View amasho's full-sized avatar
🍻
(:point_up: ՞ਊ ՞):point_up:ウェーイ

Shota Amano amasho

🍻
(:point_up: ՞ਊ ՞):point_up:ウェーイ
View GitHub Profile
@amasho
amasho / init.lua
Created December 5, 2019 08:53
Hammerspoon config
local function keyCode(key, mods, callback)
mods = mods or {}
callback = callback or function() end
return function()
hs.eventtap.event.newKeyEvent(mods, string.lower(key), true):post()
hs.timer.usleep(1000)
hs.eventtap.event.newKeyEvent(mods, string.lower(key), false):post()
callback()
end
end
@amasho
amasho / peco_select_ghq_repository.fish
Created November 6, 2018 08:49
customize peco_select_ghq_repository
function peco_select_ghq_repository
set -l query (commandline)
if test -n $query
set peco_flags --query "$query"
end
ghq list | peco $peco_flags | read line
if [ $line ]
@amasho
amasho / IntersectionObserver.html
Created June 21, 2018 01:58
IntersectionObserver demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Intersection Observer DEMO | labs.jxck.io</title>
<style>
body {
width: 100%;
@amasho
amasho / cloudSettings
Last active August 21, 2020 01:41
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-21T01:41:21.471Z","extensionVersion":"v3.4.3"}
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@amasho
amasho / brokenTuple.scala
Created October 2, 2014 07:54
tupleの壊れたデータを除外抽出する
import scala.io.Source
import java.io.FileWriter
val file = "15_10.20.4."
(1 until 9).foreach(i => {
val fw = new FileWriter(file + s"${i.toString}-2.log");
Source.fromFile(file + s"${i.toString}.log").getLines().foreach(l =>
if(l.split("\t").size == 5){ fw.write(l + "\n") }
)
fw.close()
@amasho
amasho / ssh_check.pl
Last active December 15, 2015 09:19
SSHチェック用スクリプト
#!/usr/bin/perl -w
use strict;
use Expect;
use constant SSH_CMD => "ssh -t -o StrictHostKeyChecking=no ";
use constant EXPECT_TIMEOUT => 10;
MAIN:{
exit if($#ARGV < 0);
@amasho
amasho / gist:4372745
Last active December 10, 2015 03:08
MEMO

mongodbを実行

$ sudo mongod --nojournal --noprealloc --dbpath $HOME/Sites/SampleApp/db/

nodeアプリ起動

$ forever start -o ./log/out_3000.log -e ./log/err_3000.log server.js 3000
@amasho
amasho / gist:4372741
Created December 25, 2012 11:20
nginxインストールメモ

MEMO

homebrewでそれぞれインストール

$ brew install mongodb
$ brew install redis
$ brew install lua