Skip to content

Instantly share code, notes, and snippets.

View tenten0213's full-sized avatar
💭
😇

tenten0213 tenten0213

💭
😇
View GitHub Profile
@tenten0213
tenten0213 / docker-compose.yml
Created November 16, 2016 04:10
Rocket.chat、Hubot用docker-compose.yml
rocketchat:
image: rocketchat/rocket.chat:latest
volumes:
- ./uploads:/app/uploads
environment:
- PORT=3000
- ROOT_URL=http://localhost:3000
- MONGO_URL=mongodb://mongo:27017/rocketchat
# - HTTP_PROXY=http://proxy.domain.com
# - HTTPS_PROXY=http://proxy.domain.com
@tenten0213
tenten0213 / xcode_shortcut.md
Last active November 8, 2016 10:54
Xcodeでよく使うショートカット集
@tenten0213
tenten0213 / Makefile
Last active August 29, 2015 14:13
Cygwinにtreeコマンド入れるためのMakefile
# $Copyright: $
# Copyright (c) 1996 - 2011 by Steve Baker
# All Rights reserved
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@tenten0213
tenten0213 / gen_bonjovi.rb
Last active August 29, 2015 14:09
ジョン・ボン・ジョヴィ 元ネタ: https://twitter.com/yagiyyyy/status/473405016540053504
def gen_bonjovi
bonjovi = %w(ボ ン ジョ ヴィ)]
random_jovis = []
count = 0
while(random_jovis.last(8).join != "ジョン・ボン・ジョヴィ") do
count += 1
random_jovis.push("・") if count % 2 == 0
random_jovis.push(bonjovi.sample)
end
puts random_jovis.join
@tenten0213
tenten0213 / DateUtil.java
Last active August 29, 2015 14:07
西暦和暦変換
package util;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
public class DateUtil {
@tenten0213
tenten0213 / CostMatrixBuilder.java
Last active August 29, 2015 14:02
GoSenのビルド
/*
* Copyright (C) 2001-2007
* Taku Kudoh <taku-ku@is.aist-nara.ac.jp>
* Takashi Okamoto <tora@debian.org>
* Matt Francis <asbel@neosheffield.co.uk>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or any later version.
*
from elasticsearch import Elasticsearch
es = Elasticsearch()
res = es.search(
index = 'ldgourmet',
doc_type = 'restaurants',
body= {
"query" : {
'simple_query_string': {
"query": "白金台 カフェ ボエム",
from urllib import request
from pyquery import PyQuery as pq
resp = request.urlopen("http://cookpad.com/recipe/1069312")
html = resp.read().decode("utf-8")
query = pq(html)
results = []
# レシピのメイン部を取得
@tenten0213
tenten0213 / scrape_qiita.rb
Created March 13, 2014 08:57
qiitaの自分のストックをスクレイピング
require 'open-uri'
require 'nokogiri'
# proxy設定
proxy = "http://YOUR_PROXY:8080"
proxy_user = "PROXY_USER"
proxy_pass = "PROXY_PASS"
options = { proxy_http_basic_authentication: [proxy, proxy_user, proxy_pass] }
# スクレイピング先のURL
; via http://qiita.com/ka_/items/a3f79b761e25d485f2a9
; Clojure 超入門
; print
(println "Hello World!")
; 四則演算
(+ 1 2)
(* (+ 1 2) 3) ; (1 + 2) * 3
(* (+ 1 2) (- 3 4)) ; (1 + 2) * (3 - 4)