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
counter = 0
flag = true
threads = 10.times.map do
Thread.new do
if flag
puts 'not thread safe' # IOを挟むとGVLが解放される
counter += 1
flag = false
end
@mdaisuke
mdaisuke / gist:0308c536f37e901804f058fbfac41c49
Created March 26, 2018 07:07 — forked from bluerabbit/gist:8ee1b6ac7ff0c15e47bc
ふりかえりのグランドルールとKPT法

ふりかえりのグランドルール

1. 積極的に参加すること

  • 当事者意識を持つ
  • 議題に集中すること

2. 一人で話しすぎないこと

  • 人の発言をさえぎらない
@mdaisuke
mdaisuke / c9-elixir.sh
Last active November 18, 2017 07:38 — forked from padde/c9-elixir.sh
Install Script for Erlang/Elixir/Phoenix on Cloud9
#!/usr/bin/env bash
############### USAGE ###############
#
# 1. Create a new workspace on Cloud9 using the "Blank" template
#
# 2. Run this command in the console:
# bash <(curl -fsSL https://gist.githubusercontent.com/padde/3c6301f15cbd5025e131740dae33aa95/raw/c9-elixir.sh)
#
# 3. There is no step 3!
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@mdaisuke
mdaisuke / cheese.c
Created October 14, 2017 11:34
Test Yourself - Joel on Software
#include <stdio.h>
int main(int argc, char **argv) {
int i;
for (i = 1; i < argc; i++) {
printf("%c", argv[i][0]);
}
printf("\n");
return 0;
}
@mdaisuke
mdaisuke / lmdb.tcl
Created April 30, 2017 13:29 — forked from antirez/lmdb.tcl
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
package main
import (
"encoding/csv"
"fmt"
"io"
"log"
"os"
"strconv"
"strings"
fn take_ownership(v: Vec<i32>) {
}
fn borrow_ref(v: &Vec<i32>) {
}
fn main() {
//
// Ownership
// https://doc.rust-lang.org/stable/book/ownership.html
@mdaisuke
mdaisuke / tmux.md
Created February 25, 2016 03:05 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@mdaisuke
mdaisuke / docker_cheat.md
Created December 26, 2015 16:46 — forked from tcnksm/docker_cheat.md
Docker 虎の巻

Docker 虎の巻

何故Dockerを使うべきか

Why Should I Care (For Developers)

"Dockerが面白いのはシンプルな環境に隔離性と再現性をもたらしてくれることだ.ランタイムの環境を一度作れば、パッケージにして別のマシンでも再利用することできる.さらに,すべてはホスト内の隔離された環境で行われる(VMのように).最も素晴らしい点は,シンプルかつ高速であることだ."