Skip to content

Instantly share code, notes, and snippets.

🏢
≡GO

Takenori Nakagawa ww24

View GitHub Profile
@ww24
ww24 / aliases.sh
Created Feb 26, 2018
Git や Docker を使う上で便利な aliases
View aliases.sh
# alias for git
alias git-bd='git branch -d $(git branch | while read l; do if [[ $l != \** ]] echo $l; done | peco)'
alias git-co='git checkout $(git branch | while read l; do if [[ $l != \** ]] echo $l; done | peco)'
alias git-fp='git push -u origin $(git symbolic-ref --short HEAD)'
# alias for docker
alias docker-rm-all='docker rm $(docker ps -q -f status=exited)'
alias docker-rmi-all='docker rmi $(docker images -q)'
@ww24
ww24 / .tmux.conf
Last active Jun 28, 2018
tmux 2.7 で確認済み
View .tmux.conf
# tmux 2.7
# mouse settings
set-option -g mouse on
bind -n WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Use vim keybindings in copy mode
setw -g mode-keys vi
@ww24
ww24 / file0.txt
Last active Apr 9, 2017
Raspberry Pi 3 で TV チューナー鯖構築 ref: http://qiita.com/ww24/items/0adc36c013511524da80
View file0.txt
$ lsusb | grep VidzMedia
Bus 001 Device 006: ID 3275:0080 VidzMedia Pte Ltd
$ ls /dev/dvb
adapter0
@ww24
ww24 / webapp.go
Last active Dec 10, 2015
go web app
View webapp.go
package main
import (
"github.com/cbroglie/mustache"
"github.com/gin-gonic/gin"
)
func main() {
router := gin.Default()
@ww24
ww24 / vpnclient
Last active Mar 28, 2019
SoftEther VPN 4 init.d script
View vpnclient
#! /bin/sh
### BEGIN INIT INFO
# Provides: vpnclient
# Required-Start: $remote_fs $local_fs $network $syslog
# Required-Stop: $remote_fs $local_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: SoftEther VPN Client
# Description: SoftEther VPN Client
### END INIT INFO
@ww24
ww24 / migration.js
Created May 9, 2015
WordPress migration tool
View migration.js
#!/usr/bin/env node
/**
* WordPress Image URL Migration Tool
*
*/
var from_url = "http://wordpress.local/";
var to_url = "http://example.com/wordpress/";
var cheerio = require("cheerio");
@ww24
ww24 / README.md
Last active Aug 29, 2015
Service Workers Push API Hands-on
View README.md

Service Workers Push API Hands-on

発表資料

manifest.json

gcm_sender_id は適切な値に書き換える。

localhost でテストする限りに於いては変更する必要なし。

@ww24
ww24 / minfix.sh
Last active Oct 24, 2016
ImageMagick を利用して、長方形の画像を一辺の長さを長辺に合わせた正方形に変換するシェルスクリプト
View minfix.sh
#!/bin/sh
if [ -z $1 ]; then
echo 'usage: minfix.sh image_path'
exit 1
fi
image_path=$1
min_width=511
min_height=375
@ww24
ww24 / short01.js
Last active Aug 29, 2015
Application Developer Festival 2015. Short coding. JavaScript部門 2 位. AtCoder System:JavaScript (Node.js 0.6.12)
View short01.js
/**
問題
入力: なし
出力:
高橋一郎
高橋二郎
高橋三郎
高橋四郎
高橋五郎
高橋六郎
View example.com.conf
upstream backend {
server unix:/tmp/backend.sock;
}
server {
listen 4433 ssl;
server_name _;
# SSL
ssl_certificate /usr/local/etc/openssl/certs/cert.pem;
You can’t perform that action at this time.