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
defmodule TmpMo do | |
def start_link do | |
Task.start_link(fn -> loop(%{}) end) | |
end | |
defp loop(map) do | |
receive do | |
{:get, key, caller} -> | |
send caller, Map.get(map, key) | |
{:put, key, value} -> |
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
git clone erlang/otp && cd otp | |
./otp_build autoconf | |
./configure --prefix <path-to-local> | |
make | |
make install |
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
set backspace=2 " backspace in insert mode works like normal editor | |
syntax on " syntax highlighting | |
filetype indent on " activates indenting for files | |
set autoindent " auto indenting | |
set number " line numbers | |
colorscheme desert " colorscheme desert | |
set nobackup " get rid of anoying ~file |
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
def tokenize(chars): | |
"Convert a string of characters into a list of tokens." | |
return chars.replace('(', ' ( ').replace(')', ' ) ').split() | |
def parse(program): | |
"Read a Scheme expression from a string" | |
return read_from_tokens(tokenize(program)) | |
def read_from_tokens(tokens): | |
"Read an expression from a sequence EOF of tokens." |
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
<!-- download jquery, underscore, and backbone library --> | |
<html> | |
<head> | |
<title>hoge</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="jquery-1.11.1.min.js"></script> | |
<script type="text/javascript" src="underscore-min.js"></script> | |
<script type="text/javascript" src="backbone-min.js"></script> |
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 <stdlib.h> | |
#include <stdio.h> | |
typedef struct Base { | |
struct Type *type; | |
int x; | |
} Base; | |
typedef struct Type { | |
int (*func1)(Base *this); |
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
[submodule "mpc"] | |
path = mpc | |
url = https://github.com/orangeduck/mpc |
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 ( | |
"fmt" | |
"net/http" | |
"strings" | |
) | |
func init() { | |
http.HandleFunc("/", handler) |