Skip to content

Instantly share code, notes, and snippets.

View chansuke's full-sized avatar
🎯
Focusing

Yusuke Abe chansuke

🎯
Focusing
  • Tokyo
  • 23:31 (UTC +09:00)
View GitHub Profile
@sonots
sonots / dotfiles.sh
Created December 8, 2012 11:02
Install .dotfiles
#!/bin/sh
[[ -e ~/.dotfiles ]] || git clone git@github.com:sonots/.dotfiles.git ~/.dotfiles
pushd ~/.dotfiles
git submodule init
git submodule update
for i in `ls -a`
do
[ $i = "." ] && continue
@ryosms
ryosms / GitLab4.1onUbuntu12.04.md
Last active December 11, 2015 17:09
さくらのVPSにUbuntu12.04を突っ込んでGitLab 4.1を入れる手順

1. Ubuntuのインストール

  • さくらの [VPSコントロールパネル][vps_home] から OS再インストールカスタムOSインストールへ

  • カスタムOSインストールOS選択Ubuntu 12.04 amd64 を選択

  • 注意事項を読んで 確認 ボタン → 実行 ボタン

  • VNCコンソールでインストーラーが起動するので [インストールガイド][install_guid] を参考にインストールを進める

@andelf
andelf / sendMail.go
Last active September 20, 2023 15:13
golang send mail net/smtp SMTP
package main
import (
"log"
"net/mail"
"encoding/base64"
"net/smtp"
"fmt"
"strings"
@y-ken
y-ken / nginx.conf
Last active November 19, 2019 08:11
流れに乗ってnginxのログフォーマットにLTSVを採用しました。 2013/03/05リリースのfluentd-0.10.32.gemなら標準のin_tailで、format ltsvとする事でそのまま読み込めます。 proxy先からの応答時間や送出したcookieも記録する汎用的な設定です。
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format ltsv 'domain:$host\t'
'host:$remote_addr\t'
'user:$remote_user\t'
'time:$time_local\t'
'method:$request_method\t'
'path:$request_uri\t'
@Diasporism
Diasporism / redis_and_resque.mkd
Last active March 13, 2024 08:37
How to configure Redis and Resque for your Rails app.

Redis and Resque

What this guide will cover: the code you will need in order to include Redis and Resque in your Rails app, and the process of creating a background job with Resque.

What this guide will not cover: installing Ruby, Rails, or Redis.

Note: As of this writing I am still using Ruby 1.9.3p374, Rails 3.2.13, Redis 2.6.11, and Resque 1.24.1. I use SQLite in development and Postgres in production.

Background jobs are frustrating if you've never dealt with them before. Over the past few weeks I've had to incorporate Redis and Resque into my projects in various ways and every bit of progress I made was very painful. There are many 'gotchas' when it comes to background workers, and documentation tends to be outdated or scattered at best.

@pyk
pyk / active-record-migration-expert.md
Last active August 2, 2021 09:20
become active record migration expert (Rails 4.0.2)

become active record migration expert (Rails 4.0.2)

workflow:

create model

$ rails g model NameOfModel
    invoke  active_record
    create    db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb
@hummus
hummus / gist:8592113
Last active April 26, 2024 19:45
aws cli + jq example
wget http://stedolan.github.io/jq/download/linux64/jq
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \
"Name=instance-state-name,Values=running" \
| jq -r \
".Reservations[] | .Instances[] | .InstanceId" \
aws ec2 describe-volumes --filters \
"Name=status,Values=available" \
| jq -r ".Volumes[] | .VolumeId" \
@voluntas
voluntas / erlang.rst
Last active March 15, 2024 13:15
実践 Erlang/OTP コトハジメ 2014.11

実践 Erlang/OTP コトハジメ 2014.11

更新:2014-11-20
バージョン:0.0.5
作者:@voluntas
URL:http://voluntas.github.io/

概要

@miyamoto-daisuke
miyamoto-daisuke / vpc-knowhow-2014-04.template
Last active October 20, 2020 07:02
VPC knownhow 2014-04
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "VPC knowhow template",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern": "[-_ a-zA-Z0-9]*",
@imalberto
imalberto / MainViewController.swift
Last active August 29, 2015 14:02
Swift Template
class MainViewController: UITableViewController, UITableViewControllerDelegate, UITableViewControllerDataSource {
// If using xib
override func awakeFromNib() {
super.awakeFromNib()
}
// If not using xib
func init(name: String) {
}