Skip to content

Instantly share code, notes, and snippets.

View komagata's full-sized avatar

Masaki Komagata komagata

View GitHub Profile
require 'dnsimple'
require 'platform-api'
namespace :staging do
desc "create subdomain DNS record for Heroku review app"
task :publish_dns do
heroku_app_name = ENV['HEROKU_APP_NAME']
heroku_app_name =~ /.*(pr-\d+)/
subdomain = $1
@monochromegane
monochromegane / 速習Go.md
Created July 4, 2014 09:16
速習Go。Fukuoka.go#1用の資料です。

速習Go

Go環境のつくりかた

MacOSX

homebrewでインストール

$ brew update

How to use swift in your terminal

setup

First, install Xcode 6 beta.

And run it.

sudo xcode-select -switch /Applications/Xcode6-Beta.app/Contents/Developer
@knibals
knibals / Youtube API sample with GO
Last active March 2, 2021 03:29 — forked from ikai/gist:1f746b018664f604e4cc
Code example for connection to Youtube API (written in Go -- #golang)
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"io/ioutil"
"log"
"net"
@hgfischer
hgfischer / benchmark+go+nginx.md
Last active April 11, 2024 22:09
Benchmarking Nginx with Go

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI
Kernel.class_eval do
#FIXME this is terrible
def static(meth)
define_singleton_method(meth) do |*args, &b|
new.send meth, *args, &b
end
meth
end
def abstract(meth)
@textarcana
textarcana / mac_xwindows_x11_xvfb_headless_firefox_howto.md
Last active April 19, 2023 01:53
Headless Selenium on CentOS 6.3 (Mac XWindows / X11 / Xvfb / Headless Firefox / Selenium howto)

XWindows for Headless Selenium

X Wing art by Paul Harckham

How to set up a Headless Selenium Testing environment for CentOS 6.3.

On your CentOS 6.3 host

Follow these steps to set up a CentOS 6.3 host to run headless Selenium tests with Firefox.

2013 年の新卒研修メニュー

Rails Tutorial

目的

  • 2013 年で Web アプリケーションを作る時にモダンな方法で一通り Web アプリケーションを自分一人で作れるようになってもらう
  • 作る過程で Web 開発で必要とされるスキルセットを身につけてもらう

教材と教える項目

@taea
taea / cherry-pick-for-sass.md
Last active December 12, 2015 11:59
git-cherry-pickでmasterのSassを最新に

git-cherry-pick で master のSassを最新に

トピックブランチでデザイン作業後、masterにマージされるまでの間、masterのSassが最新のものから乖離してしまって作業が進められない問題を解決するために、git-cherry-pickで必要なSassの変更のみをmasterに取り込む

※この際、Sassだけcommitを分けると楽 → 不要なファイルやコンフリクトがなければそのままcommitごとmasterに取り込まれるので超ベンリです。

手順

作業中のトピックブランチで git log して必要なcommitのIDをコピー

$ git log

commit一覧が出てくるので、masterに取り込みたい「commit」の右側の文字列をコピー(下記の場合は 88ca4f2b3958748baf9947dcf1fdaebc01616cf6 をコピー)

@mreinsch
mreinsch / simple_assets.rb
Last active December 10, 2015 00:28
Speed up asset compilation by simply coping assets if nothing changed (based on git). Also works fine with turbo_sprockets. Load this with: load 'simple_assets' in your deploy.rb
load 'deploy' unless defined?(_cset)
_cset :asset_env, "RAILS_GROUPS=assets"
_cset :assets_prefix, "assets"
_cset :assets_role, [:web]
_cset :normalize_asset_timestamps, false
after 'deploy:update_code', 'deploy:assets:precompile'