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 / 阿澄佳奈で抜いたことあります.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 / 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 / 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")
@entyo
entyo / install_firacode.sh
Created August 19, 2017 05:22
Firacode install script
mkdir -p ~/.local/share/fonts
for type in Bold Light Medium Regular Retina; do
wget -O ~/.local/share/fonts/FiraCode-${type}.ttf \
"https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-${type}.ttf?raw=true";
done
fc-cache -f
@entyo
entyo / Dockerfile
Last active September 16, 2017 08:33
angular-cliをやっていきするためのDockerfile
FROM node:latest
# prepare a user which runs everything locally! - required in child images!
RUN useradd --user-group --create-home --shell /bin/false app
ENV HOME=/home/app
WORKDIR $HOME
RUN npm install -g yarn@1.0.2 && yarn global add @angular/cli@latest && yarn cache clean
@entyo
entyo / splat.js
Last active September 23, 2017 03:27
JavaScriptで学ぶ関数型プログラミング
function splat(fn) {
return array => {
return fn.apply(null, array);
};
}
const addArrayElements = splat((x, y) => x + y);
// returns 3
addArrayElements([1, 2]);
@entyo
entyo / .zprofile
Last active October 1, 2017 08:41
if [[ -z "$LANG" ]]; then
export LANG='en_US.UTF-8'
fi
#
# Paths
#
# Ensure path arrays do not contain duplicates.
typeset -gU cdpath fpath mailpath path