Skip to content

Instantly share code, notes, and snippets.

View takakd's full-sized avatar
🧑‍💻
coding, coding, and coding

Takahiro Kudo takakd

🧑‍💻
coding, coding, and coding
  • VIdeo Market Corp.
  • Japan
View GitHub Profile
@takakd
takakd / scp.sh
Created April 5, 2020 05:42
scp command.
#!/usr/bin/env bash
# Required: macOS 10.14.5
# copy local to remote
$ scp -i ~/.ssh/id_rsa -r /home/localuser/local_dir sshuser@<ip>:/home/remoteuser/dir_placed_local_dir/
# copy remote to local
$ scp -i ~/.ssh/id_rsa -r sshuser@<ip>:/home/remoteuser/remote_dir /home/localuser/dir_placed_remote_dir/
@takakd
takakd / README.md
Created March 28, 2020 19:11
readme example.

README

Name

Overview

[Description]

Requirement

@takakd
takakd / postgresql_update_seq_by_last_value.sql
Created March 10, 2020 12:50
Update sequence by last_value in PostgreSQL
-- update sequence by last_value
SELECT setval('some_table_seq', (SELECT last_value FROM some_table_seq)+1);
@takakd
takakd / create_wip_branch.sh
Created March 10, 2020 10:41
Create branch for wip.
#!/usr/bin/env bash
git checkout -b for_wip
git commit --allow-empty -m "wip"
git push
@takakd
takakd / config.toml
Last active November 18, 2017 16:14
sample-hugo-json
baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
[outputs]
section = ["JSON", "HTML"]
@takakd
takakd / index.json
Created November 6, 2017 17:13
sample-hugo-json
{
"posts": [
{
"id" : "20171004010101",
"date" : "2017.10.04",
"title" : "Post4",
"summary" : "etc4 etc4\u0026hellip;",
"body" : "\u003cp\u003eetc4 etc4\u0026hellip;\u003c/p\u003e\n",
"tags" : [],
"some-ex-param" : "test4"
@takakd
takakd / list.json.go
Last active November 6, 2017 17:23
sample-hugo-json
{
"posts": [
{{ $list := .Data.Pages -}}
{{ $len := (len $list) -}}
{{ if lt 0 $len -}}
{{ range first 1 $list -}}
{
"id" : {{ .Date.Format "20060102150405" | jsonify }},
"date" : {{ if .Date }}{{ .Date.Format "2006.01.02" | jsonify }}{{else}}""{{end}},
"title" : {{ .Title | jsonify }},
@takakd
takakd / 0_reuse_code.js
Created August 16, 2017 08:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/bin/bash
# for mac.
SEGMENT="192.168.1."
for i in `seq 1 255`; do
RET=`ping -c 1 -W 1000 ${SEGMENT}${i}`
echo "${RET}" | grep '100.0% packet loss' > /dev/null
if [ $? -eq 1 ]; then
echo "found,${SEGMENT}${i}"
@takakd
takakd / pt_menuitem.vim
Last active January 8, 2017 16:42 — forked from 17g/grep_menuitem.vim
NerdTreePluginのgrep_menuitem.vimって便利だけど実行後にこっそりカレントディレクトリが変更されてしまってる。。スペースなどが入った場合もそのまま検索できるようにしたかった。なので少し付け加え。Forked from https://gist.github.com/masaakif/414375
"shove this in ~/.vim/nerdtree_plugin/grep_menuitem.vim
"
"A really rough integration of :grep with nerdtree. Adds a 'g' menu item that
"prompts the user for a search pattern to use with :grep. :grep is run on the
"selected dir (using the parent if a file is selected)
"
" Originally written by scrooloose
" (http://gist.github.com/205807)
" Forked by masaakif
" (http://gist.github.com/205807)