Skip to content

Instantly share code, notes, and snippets.

edvakf

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 slide.md

gitlab bot を使って
コードレビューを
ラクにする話

自己紹介

  • 名前:高山
  • twitter:@edvakf
  • お仕事:
  • pixivのGrowthに関する開発
View euler78-2.fsx
open System.Collections.Generic
let limit = 100000
let divisor = 1000000
let memo = new Dictionary<int,int> ()
let rec partitions = fun (n, m) ->
if (n >= limit || m >= limit) then 0
elif (n = 0) then 1
View geolite2_country_ipv4_mask_blocks.rb
#!/usr/bin/env ruby
# coding: utf-8
require 'set'
module GeoLite2_Country
class IPv4Block < Struct.new(:start_ip,
:mask_length,
:geoname_id)
def self.from_line(line)
View poc.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View BloomFilter.php
<?php
class BloomFilter
{
const BYTE = 8;
private $filter;
private $filter_length;
private $bit_num;
private $hash_num;
View gist:1a82843b6da3d718696d
# 10.2s user time, 210ms system time, 41.18M rss, 233.52M vsz
# Current date: Tue Sep 23 08:18:18 2014
# Hostname: ip-172-31-16-67
# Files: /var/lib/mysql/ip-172-31-16-67-slow.log
# Overall: 43.92k total, 45 unique, 422.35 QPS, 1.68x concurrency ________
# Time range: 2014-09-23 08:15:33 to 08:17:17
# Attribute total min max avg 95% stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 174s 3us 609ms 4ms 38ms 15ms 84us
@edvakf
edvakf / main.go
Created Sep 26, 2014
gob serialize
View main.go
package main
import (
"bytes"
"database/sql"
"encoding/gob"
"log"
Radix "github.com/fzzy/radix/extra/pool"
)
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)
Future(process.#>(out).run())
val reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))
@edvakf
edvakf / rt-router.php
Last active Aug 29, 2015
フレームワークではなくライブラリとして使うPHPのルーター案
View rt-router.php
<?php
if ($m = RT::get('/works/:id' /*pathパターン*/, [':id:uint' /*pathのパラメータ*/])) {
getWorks($m[':id']);
} 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 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
You can’t perform that action at this time.