Skip to content

Instantly share code, notes, and snippets.

View mdaisuke's full-sized avatar
:octocat:
write code

mdaisuke mdaisuke

:octocat:
write code
View GitHub Profile
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} ->
git clone erlang/otp && cd otp
./otp_build autoconf
./configure --prefix <path-to-local>
make
make install
@mdaisuke
mdaisuke / minimum.vimrc
Created November 11, 2015 06:12
minimal vimrc
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
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."
<!-- 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>
#include <stdlib.h>
#include <stdio.h>
typedef struct Base {
struct Type *type;
int x;
} Base;
typedef struct Type {
int (*func1)(Base *this);
[submodule "mpc"]
path = mpc
url = https://github.com/orangeduck/mpc
@mdaisuke
mdaisuke / showing_ip_gae.go
Created June 21, 2014 10:48
何となくIP表示するGAEアプリ
package main
import (
"fmt"
"net/http"
"strings"
)
func init() {
http.HandleFunc("/", handler)