- git clone プロジェクト
- dep のインストール
- go自体にpathが通っているか確認
- 通っていなければ
export PATH=$HOME/local/go/bin:$HOME/go/bin:$PATH
<- これとは限らないので臨機応変に go get -u github.com/golang/dep/cmd/dep
- gopathの設定
export GOPATH=/path/to/{プロジェクト名}/webapp/go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filetype plugin indent on | |
syntax on | |
" mapleader | |
let mapleader = "," | |
nnoremap <Leader>e :Explore<CR> | |
nnoremap <Leader>se :Sexplore<CR> | |
nnoremap <Leader>ve :Vexplore<CR> | |
set nocompatible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" | |
"Maintainer: Greg Sexton <gregsexton@gmail.com> | |
"Last Change: 2012-08-04 | |
"Version: 1.0 | |
"URL: http://www.gregsexton.org/vim-color-schemes/muon/ | |
set background=dark | |
if version > 580 | |
"no guarantees for version 5.8 and below, but this makes it stop complaining | |
hi clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct Fractional: CustomStringConvertible, Equatable { | |
let value: (Int, Int) | |
var num: Int { | |
return value.0 | |
} | |
var den: Int { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func setSheetsToRedis(sheets []Sheet) { | |
conn, err := redis.Dial("tcp", "localhost:6379") | |
if err != nil { | |
panic(err) | |
} | |
defer conn.Close() | |
// primitive型以外はjson.Marshalする | |
serialized, _ := json.Marshal(sheets) | |
conn.Do("SET", sheetKey, serialized) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"errors" | |
"time" | |
"github.com/patrickmn/go-cache" | |
) | |
const ( | |
messageNumPrefix = "MSG-NUM-" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ARGV[0] : filepath | |
# ARGV[1] : kind (account | friends) | |
if ARGV.size < 2 | |
puts "Error: argument num is not enough" | |
exit | |
end | |
path = ARGV[0] | |
kind = ARGV[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/gomodule/redigo/redis" | |
) | |
// example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void swap(int *x, int *y) | |
{ | |
int temp = *x; | |
*x = *y; | |
*y = temp; | |
} | |
void bubbleSort(int array[], int length) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import Foundation | |
class LinkedList<T: CustomStringConvertible> { | |
var head: Node<T>? = nil | |
class Node<T> { | |
var value: T |