Skip to content

Instantly share code, notes, and snippets.

@entyo
entyo / IFTTT.py
Created August 13, 2015 15:08
"Hello, IFTTT" for python script.
import requests
requests.post("http://maker.ifttt.com/trigger/HOGEHOGE/with/key/FUGAFUGA, json={"value1": "Hello, IFTTT!"})
@entyo
entyo / fuck.js
Created October 9, 2015 01:29
時計的な
$(function() {
setInterval(function() {
var d = new Date();
var formatDate =
d.getFullYear() + '年' +
(d.getMonth() + 1) + '月' +
d.getDate() + '日 ' +
d.getHours() + '時' +
d.getMinutes() + '分';
$("#time").text(formatDate);
@entyo
entyo / .vimrc
Last active March 13, 2018 03:35
.vimrc
" 色づけを on にする
set t_Co=256
syntax on
" ハイライトサーチを有効にする
set hlsearch
" 大文字小文字を区別しない(検索時)
set ignorecase
" ただし大文字を含んでいた場合は大文字小文字を区別する(検索時)
set smartcase
@entyo
entyo / fuck.cfg
Created December 25, 2015 09:23
fuck.cfg
indent_align_string=true
indent_braces=false
indent_braces_no_func=false
indent_brace_parent=false
indent_namespace=false
indent_extern=false
indent_class=true
indent_class_colon=true
indent_else_if=false
indent_func_call_param=false
@entyo
entyo / 阿澄佳奈で抜いたことあります.py
Last active February 15, 2016 14:43
ゆのっちフィボナッチ
# -*- coding: utf-8 -*-
import sys
def fib(n):
if n <= 2:
return 1
else:
return fib(n-1) + fib(n-2)
if __name__ == "__main__":
/* 前略、道の上より */
func main() {
anaconda.SetConsumerKey(config.ConsumerKey)
anaconda.SetConsumerSecret(config.ConsumerSecret)
api := anaconda.NewTwitterApi(config.AccessToken, config.AccessTokenSecret)
v := url.Values{}
v.Set("follow", "ID1, ID2, ...") //set user IDs(NOT screen names)
stream := api.PublicStreamFilter(v)
for {
select {
@entyo
entyo / .zshrc
Last active January 27, 2018 13:00
.zshrc
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
# zsh起動時にtmux起動
[[ -z "$TMUX" && ! -z "$PS1" ]] && exec tmux
# ranger
alias ranger='TERM=xterm-256color ranger' # To use solarized theme :(
@entyo
entyo / .zpreztorc
Last active January 22, 2018 05:11
.zpreztorc
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
@entyo
entyo / .tmux.conf
Last active January 22, 2018 05:20
viモード
set-window-option -g mode-keys vi
#y and p as in vim
bind p paste-buffer
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'r' send-keys -X rectangle-toggle
bind-key -T copy-mode-vi 'Space' send-keys -X halfpage-down
bind-key -T copy-mode-vi 'Bspace' send-keys -X halfpage-up
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i'
@entyo
entyo / shit.go
Created March 12, 2017 04:11
http.Responseのbodyを見たいとき
// bodyの確認
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
}
fmt.Printf("body: " + string(body) + "\n")