Skip to content

Instantly share code, notes, and snippets.

View tadyjp's full-sized avatar

tady (GitHub) tadyjp

View GitHub Profile
@tadyjp
tadyjp / letsencrypt.sh
Last active January 14, 2016 00:58
Let's encryptの証明書取得スクリプト(Amazon Linuxで動作確認済み)
# Install libraries
sudo yum update
sudo yum install git nginx
sudo service nginx start
# Install letsencrypt script
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
# Make request to Let's encrypt server
@tadyjp
tadyjp / wishlist.md
Last active February 7, 2016 10:30
作りたいもの
  • ブラウザで簡単暗号ファイル/テキスト送信
  • Githubの特定の拡張子のみレビュー
  • staging用SSO
  • Github tagからChange logを自動生成するサービス
  • ブランチ切替時にRails再起動してくれるツール
  • 提案資料まとめサイト
  • togglとgit hook, chrome extentionの連携
  • Google Document + Git(hub)
    • Git(hub)を使えない人でもコラボレーションできる仕組み
@tadyjp
tadyjp / nginx-mruby-debug.rb
Created July 5, 2015 11:43
nginx mruby debug
r = Nginx::Request.new
Nginx.echo "Nginx::Var#http_host : #{r.var.http_host}"
Nginx.echo "Nginx::Var#http_user_agent : #{r.var.http_user_agent}"
Nginx.echo "Nginx::Var#http_referer : #{r.var.http_referer}"
Nginx.echo "Nginx::Var#http_via : #{r.var.http_via}"
Nginx.echo "Nginx::Var#http_x_forwarded_for : #{r.var.http_x_forwarded_for}"
Nginx.echo "Nginx::Var#http_cookie : #{r.var.http_cookie}"
Nginx.echo "Nginx::Var#content_length : #{r.var.content_length}"
Nginx.echo "Nginx::Var#content_type : #{r.var.content_type}"
@tadyjp
tadyjp / hipchat-todo.coffee
Created December 29, 2014 09:04
hipchat-todo.coffee
# Description:
# Example scripts for you to examine and try out.
#
# Notes:
# They are commented out by default, because most of them are pretty silly and
# wouldn't be useful and amusing enough for day to day huboting.
# Uncomment the ones you want to try and experiment with.
#
# These are from the scripting documentation: https://github.com/github/hubot/blob/master/docs/scripting.md
@tadyjp
tadyjp / private.xml
Created December 28, 2014 08:55
FILCO Bluetooth Keyboad FFBT67ML/EB用セッティング for Karabiner
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>FILCO_Bluetooth_Keyboard_VendorID</vendorname>
<vendorid>0x0a5c</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>FILCO_Bluetooth_Keyboard_ProductID</productname>
<productid>0x8502</productid>
</deviceproductdef>
@tadyjp
tadyjp / file0.swift
Last active August 29, 2015 14:10
ElasticsearchとSwiftで簡単mBaaSサンプルアプリ ref: http://qiita.com/tady/items/847eff27bdda3af621bb
let res = Alamofire.request(.POST, "http://localhost:9200/twitter/tweet/_search?q=user:\(self.username)", parameters: nil, encoding: .JSON)
.responseJSON { (_, _, json, _) -> Void in
let sjson = JSON(json!)
if let hits = sjson["hits"]["hits"].array {
var tweets = [] as [String]
for subJson: JSON in hits {
println(subJson["_source"]["message"].string!)
tweets.append(subJson["_source"]["message"].string!)
}
block(tweets)
...
alias ssh='~/bin/iterm2-set-background'
...
@tadyjp
tadyjp / Gemfile
Created November 19, 2014 00:43
Google Analytics API by ruby
source "https://rubygems.org"
gem "google-api-client", git: '[email protected]:google/google-api-ruby-client.git'
@tadyjp
tadyjp / tady.zsh-theme
Created November 6, 2014 23:10
zsh tady theme
# tady theme inspired by mh
# features:
# path is autoshortened to ~30 characters
# displays git status (if applicable in current folder)
# turns username green if superuser, otherwise it is white
# if superuser make the username green
if [ $UID -eq 0 ]; then NCOLOR="green"; else NCOLOR="white"; fi
@tadyjp
tadyjp / after
Last active August 29, 2015 14:08
プロジェクト内のerbファイルのフォーマットを一発で綺麗にするコマンド - Run htmlbeautifier recursively. ref: http://qiita.com/tady/items/c5800c025f150b6b6db5
<div class="header">
<p class="logo"><a href="/">ロゴ</a></p>
<ul class="header_nav">
<li><span class=""><i class=""></i>メニュー</span></li>
</ul>
<div class="menu">
<ul>
<li><a class="menu_list_btn">メッセージ</a>
<ul class="menu_list">
<li><%= link_to "AAAAA", aaaaa_path %></li>