Skip to content

Instantly share code, notes, and snippets.

View amanoese's full-sized avatar
😎

Seito Taka amanoese

😎
View GitHub Profile
@amanoese
amanoese / 標準入力をリストに入れる(切り出し版?).go
Last active September 30, 2019 10:52
Paizaを始めるためのGoコード?
package main
import (
"fmt"
"bufio"
"os"
)
func read_input() *[]string{
sc:=bufio.NewScanner(os.Stdin)
var lines []string
@amanoese
amanoese / dousi.json
Created August 10, 2019 04:04
シェル芸ツイーター用
{"安らぎ":"00",
"為す":"01",
"移る":"02",
"育み":"03",
"育む":"04",
"引き":"05",
"引き継が":"06",
"引き裂く":"07",
"羽ばたき":"08",
"渦巻く":"09",
sed -i 's/#Port 22/Port 443/' /etc/ssh/sshd_config
systemctl restart sshd
import { db } from '@/plugins/vuefire.js'
import { firebaseMutations,firebaseAction } from 'vuexfire'
export default {
state: {
todos: [],
},
mutations: {
addTodo(state,todo){
state.todos.push(todo)
@amanoese
amanoese / file0.txt
Last active April 17, 2019 15:02
Git Bashのttyで怒られないように ref: https://qiita.com/amanoese/items/7b237e8703c3b4c7f001
$ docker run -it alpine echo Hello,World
the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty'
$ echo 'console.log("Hello,world")' | node
stdin is not a tty
@amanoese
amanoese / beautifully
Last active September 5, 2019 02:39
jqが使えなくても大丈夫なJavaScriptシェル芸 ref: https://qiita.com/amanoese/items/c9af690abd2e568c5117
$ cat <(sed '1s/^/_=/' sample.big.json) <(echo 'JSON.stringify(_.docs.slice(0,3).map(v=>v._id),null,"\t")') | node -p -
[
"14cd7192b2d699a606bde01c3123c750",
"14cd7192b2d699a606bde01c3123d685",
"14cd7192b2d699a606bde01c3123ddd4"
]
$ ffmpeg -i in.mp4 -vf "scale=iw/3:ih/3" -r 10 out.gif
p = pdfjslib.getdocument("https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf").then(pdf=>{
console.log('ok!')
window.pdf = pdf
pdf.getpage(1).then(page=>{
window.page = page
console.log("======================")
window.text = page.gettextcontent()
})
})
@amanoese
amanoese / date.sh
Last active November 5, 2017 15:40
date.hatena.blog
$ seq 0 5 | xargs -n1 -i date -d+{}days -I
# formatや基準日を変えたいときは
$ seq 1 10 | xargs -n1 -i date -d2017/01/01+{}days +%Y%m%d
@amanoese
amanoese / ailias
Created June 23, 2017 05:10
docker run command
docker run -v $PWD:/usr/src/`basename $PWD` -w /usr/src/`basename $PWD` -it ubuntu