Skip to content

Instantly share code, notes, and snippets.

@mattd
mattd / gist:1006398
Created June 3, 2011 14:12
nginx try_files with a proxy_pass
server {
root /var/www/example.com/static;
server_name example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
try_files /maintenance.html @proxy;
location @proxy {
proxy_pass http://127.0.0.1:10001;
@wadey
wadey / iterm2.zsh
Last active March 10, 2024 00:32
Change iTerm2 tab color when using SSH
# Usage:
# source iterm2.zsh
# iTerm2 tab color commands
# https://iterm2.com/documentation-escape-codes.html
if [[ -n "$ITERM_SESSION_ID" ]]; then
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
def index(id:String) = Action {
getFirstData(id)
}
private def getFirstData(id:String) = {
Cache.get(id) match {
case Some(id2) => getSecondData(id2)
case None => NotFound
}
}
private def getSecondData(id2:String) = {
@rirakkumya
rirakkumya / gist:2694235
Created May 14, 2012 14:15
モナドはリラックマだ in scala

モナドはリラックマだ

モナドはコンテナだ。リラックマもコンテナ(中身入ってるし)だ。
だったら、モナドはリラックマだ。

と言う訳で、リラックマでモナド則書いてみた。

まず、リラックマの実装。リラックマは、皮と中身がある。そもそもいない時もある。
まさにMaybeだ。なので、Optionにしてみる。
えぇ手抜きですとも。

@dnishimura
dnishimura / Makefile.golang
Created June 20, 2012 17:51 — forked from yanatan16/Makefile.golang
Makefile for Golang projects
# Makefile for a go project
#
# Author: Jon Eisen
# site: joneisen.me
#
# Targets:
# all: Builds the code
# build: Builds the code
# fmt: Formats the source files
# clean: cleans the code
@keiya
keiya / KDB.php
Created August 1, 2012 08:05
Database O/RM
<?php
/*
* KDB database wrapper by Keiya Chinen <keiya_21@yahoo.co.jp>
*/
class KDB {
public function __construct ($user,$pass,$db,$host) {
$this->mysqli = new mysqli($host, $user, $pass, $db);
if ($this->mysqli->connect_error) {
@thinca
thinca / neobundle
Created August 22, 2012 02:14
neobundle command
#!/bin/sh
if [ -z "$1" ]; then
echo Usage: $0 {config-file}
exit
fi
vim -N -u NONE -i NONE -V1 -e -s --cmd "source $1" --cmd NeoBundleInstall! --cmd qall!
@ritou
ritou / cookiesync.md
Last active April 14, 2023 12:45
Cookie Syncについてのメモ

Cookie Syncの調査メモ

RTB周りで使われているというCookie Syncについて興味がわいたので調べてみる。

http://www.scaleout.jp/26992/

DMP-DSP間

Quoraから。

@nekoruri
nekoruri / AWS大好き男に「どの機能が好き?」と訊ねられたとき、女はどう答えたらいいの?
Last active January 25, 2021 15:13
AWS大好き男に「どの機能が好き?」と訊ねられたとき、女はどう答えたらいいの?
あ、まず前提として、
貴女がAWS大好き男を夢中にさせることが、
はたして貴女を幸福にするかどうか、それはまた別問題だけれど。
とはいえ、AWS大好き男たちは玉石混交ながら、
SIer系の超上流な男なども多く、
したがって、釣り師たる女たちにとっては、
なかなかあなどれない釣り場です。
では、AWS大好き男に「どの機能が好き?」と訊ねられたとき、