Skip to content

Instantly share code, notes, and snippets.

@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@moznion
moznion / cpanize_minil.md
Last active August 29, 2015 14:07
Minilla使ってCPANにブツを上げる

ホームディレクトリに.pauseというファイルを作る

$ vi ~/.pause

以下のように書く

user USER_NAME
@edvakf
edvakf / main.go
Created September 26, 2014 12:20
gob serialize
package main
import (
"bytes"
"database/sql"
"encoding/gob"
"log"
Radix "github.com/fzzy/radix/extra/pool"
)
@geta6
geta6 / _秘伝のたれ.sh
Created March 27, 2014 14:19
cronで回すと$TARGET内にある`.mp4` で終わらないファイルを自動でエンコードします
#!/bin/zsh
USER='nouser'
GROUP='nogroup'
TARGET='require to set'
function source
{
find $TARGET -type f \( ! -iname '.*' \) | sed -E 's/ */ /g' | grep -vE 'mp4$' | sort -t'/' -k 5nr -k 6n
}
@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
@edvakf
edvakf / README.md
Last active December 22, 2015 08:29
PHPコードの複雑さチェック

complexity.php

使い方

php complexity.php filename

出力形式

@nebiros
nebiros / Gemfile
Created May 23, 2012 15:58
rails + unicorn + rbenv + init.d daemon
group :production do
gem "unicorn"
end
@doches
doches / reference.lua
Created March 27, 2012 19:47
Lua Cheat Sheet
-- Lua Cheat Sheet for Programmers, by Al Sweigart http://coffeeghost.net
-- This cheat sheet is an executable Lua program.
--[[ This is
a multline comment]]
---[[ This is a neat trick. The first -- makes -[[ not a multiline comment.
print("This line executes.")
--]] The rest of this line is also a comment.
print("Here is a string" .. ' concatenated with ' .. 2 .. ' other strings.')
@caseyohara
caseyohara / reserved_usernames.rb
Created December 9, 2011 22:58
A list of reserved usernames to avoid vanity URL collision with resource paths
# A list of possible usernames to reserve to avoid
# vanity URL collision with resource paths
# It is a merged list of the recommendations from this Quora discussion:
# http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
# Country TLDs found here:
# http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
# Languages found here: