Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block edvakf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View A
$ mkdir rack-test
$ cd rack-test
$ vi Gemfile
$ vi
$ vi unicorn_config.rb
$ bundle install --path=.bundle
$ bundle exec unicorn -c ./unicorn_config.rb
View gist:a871d5606ae5a3122c84000009477681
# apache2を再起動
sudo systemctl restart apache2
# apache2の設定を再読み込み
sudo systemctl reload apache2
# apache2を止める
sudo systemctl stop apache2
View simd-test.js
var a = SIMD.Float32x4(1.0,2.0,3.0,4.0);
var b = SIMD.Float32x4(5.0,6.0,7.0,8.0);
var c = SIMD.Float32x4.add(a,b);
console.log(SIMD.Float32x4.extractLane(c, 0));
console.log(SIMD.Float32x4.extractLane(c, 1));
console.log(SIMD.Float32x4.extractLane(c, 2));
console.log(SIMD.Float32x4.extractLane(c, 3));
var a = SIMD.Int32x4(1,2,3,4);
var b = SIMD.Int32x4(5,6,7,8);
edvakf / Rpc.scala
Last active Aug 29, 2015
View Rpc.scala
import com.ning.http.client.providers.netty.NettyResponse
import org.apache.thrift.protocol.TBinaryProtocol
import org.apache.thrift.transport.{TMemoryInputTransport, TMemoryBuffer, THttpClient}
import org.apache.thrift.{TException, TServiceClient, TServiceClientFactory}
import play.api.Play.current
import scala.concurrent.Future
import scala.util.control.NonFatal
View mymaybe.hs
data MyMaybe a = MyNothing | MyJust a deriving (Show)
instance Functor MyMaybe where
fmap f MyNothing = MyNothing
fmap f (MyJust a) = MyJust (f a)
instance Applicative MyMaybe where
pure x = MyJust x
MyNothing <*> _ = MyNothing
_ <*> MyNothing = MyNothing
View mylist.hs
data MyList a = MyEmpty | MyCons a (MyList a) deriving (Show)
instance Functor MyList where
fmap f MyEmpty = MyEmpty
fmap f (MyCons x xs) = MyCons (f x) (fmap f xs)
instance Applicative MyList where
pure x = MyCons x MyEmpty
MyEmpty <*> _ = MyEmpty
_ <*> MyEmpty = MyEmpty
edvakf / rt-router.php
Last active Aug 29, 2015
View rt-router.php
if ($m = RT::get('/works/:id' /*pathパターン*/, [':id:uint' /*pathのパラメータ*/])) {
} else if ($m = RT::get('/works/', ['page:uint:1' /*GETパラメータ。デフォルト1*/, 'type:string:' /*GETパラメータ。デフォルト空文字*/, 'tags:string[]' /*GETパラメータ。配列のみ受け取る。デフォルトは空配列?*/])) {
getWorks($m['page'], $m['type'], $m['tags']);
View ProcessEnumerator.scala
object ProcessEnumerator {
// wraps a ProcessBuilder with Play's Enumerator
// and executes the process in Future
// so that the process' output can be streamed
def apply(process: ProcessBuilder): Enumerator[String] = {
val in = new PipedInputStream()
val out = new PipedOutputStream(in)
val reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))



func md5hash(text []byte) string {
	h := md5.New()
	return fmt.Sprintf("%x", h.Sum(nil))
View heapq.go
package heapq
import "errors"
type intMaxHeap struct {
buf []int
length int
func (h *intMaxHeap) Cap() int {
You can’t perform that action at this time.