Skip to content

Instantly share code, notes, and snippets.

View krrrr38's full-sized avatar
💭
🍣

Ken Kaizu krrrr38

💭
🍣
View GitHub Profile
update
upgrade
tap homebrew/binary || true
tap phinze/homebrew-cask || true
install brew-cask
install ack
install android-sdk
install autoconf
@krrrr38
krrrr38 / playvm
Last active August 29, 2015 13:58
play version manager based on svm(https://github.com/yuroyoro/svm)
#!/usr/bin/env bash
# Copyright (c) 2011 Tomohito Ozaki(yuroyoro)
# 2014 Ken Kaizu(krrrr38)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
@krrrr38
krrrr38 / gist:10515475
Last active August 29, 2015 13:59
サブルーチンプロトタイプに関数与えた際に勝手に付くuseとか
#!/usr/bin/env perl
use strict;
use utf8;
use Data::Dumper::Concise;
sub hoge(&;$) {
my $a = shift;
warn Dumper($a);
return $a->();
@krrrr38
krrrr38 / gist:5e9dce25e41e41ee57b9
Last active August 29, 2015 14:00
goroutineに出来ないのなんで
package main
import "fmt"
func rec(depth int, ch chan int) {
if depth > 3 {
return
} else {
ch <- depth
rec(depth+1, ch) // cannot be gorouting
@krrrr38
krrrr38 / gist:f94c54678bc02224a8f5
Created May 5, 2014 03:58
A Tour of Go - Exercise: Web Crawler
package main
import (
"fmt"
"sync"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
# -*- coding: utf-8 -*-
##############################
##### Working with lists #####
##############################
def last(ls)
ls[-1]
end
scala> case class InvalidData(i: Int)
defined class InvalidData
scala> def firstProcess(i: Int): Either[InvalidData, Int] = try{ Right(10 / i) } catch { case _: Throwable => Left(InvalidData(i)) }
firstProcess: (i: Int)Either[InvalidData,Int]
scala> def secondProcess(d: InvalidData): Either[InvalidData, Int] = try{ Right(10 + d.i) } catch { case _: Throwable => Left(InvalidData(d.i)) }
secondProcess: (d: InvalidData)Either[InvalidData,Int]
scala> for { a <- firstProcess(2).left; b <- secondProcess(a).right } yield b
@krrrr38
krrrr38 / Global.scala
Created August 17, 2014 08:07
SecureSocial 3.0(milestone 1) with Custom OAuth Provider
import java.lang.reflect.Constructor
import providers.HatenaProvider
import securesocial.core.RuntimeEnvironment
import securesocial.core.providers._
import service.{DemoUser, MyEventListener, InMemoryUserService}
import scala.collection.immutable.ListMap
object Global extends play.api.GlobalSettings {

!SLIDE

Typelevel FizzBuzz in Scala

@halcat0x15a

!SLIDE

型レベルプログラミング

@krrrr38
krrrr38 / install nginx
Last active August 29, 2015 14:22
nginx
# http://openresty.org/ : with lua
groupadd -g 501 nginx
sudo useradd -g nginx -u 501 -s /sbin/nologin -d /var/www nginx
sudo yum install -y gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
# normal nginx (or --prefix=/usr/local/nginx)
./configure \
--user=nginx \
--group=nginx \