Skip to content

Instantly share code, notes, and snippets.

View igrep's full-sized avatar
:shipit:
Programming in TypeScript, Python, or Haskell.

YAMAMOTO Yuji igrep

:shipit:
Programming in TypeScript, Python, or Haskell.
View GitHub Profile
@tmm1
tmm1 / sample.gif
Last active December 11, 2020 07:40
View Profiler
sample.gif
@kaosf
kaosf / 2014-precure-advent-calendar-23.md
Last active August 29, 2015 14:12
はじけるCommonの香り!キュアClojure!

プリキュア Advent Calendar 2014 - Adventar の 23 日目の記事です.

Clocure

Clojure + Precureという意味で命名された,PycureおよびRubicureリスペクトです.

つまり世界初のLispによるプリキュア実装です.更にJVMのためのプリキュア実装でもあります.

ソースコードは kaosf/clocure にあります.ここから Clojars (Clojureのライブラリ登録サービス) へのリンクなども確認出来ます.

@joker1007
joker1007 / calculator.rb
Created January 17, 2015 06:25
神奈川Ruby会議01
require 'bundler/setup'
require 'tapp'
class Operator
def initialize(left, right)
@left = left
@right = right
end
end
@tokiwoousaka
tokiwoousaka / gist:69165be983834d427416
Last active August 29, 2015 14:19
THのlocation関数テスト
{-# LANGUAGE TemplateHaskell#-}
module Main where
import Language.Haskell.TH
$( do
location >>= runIO . (\loc -> do
putStrLn $ loc_filename loc -- THの書かれたファイル名
putStrLn $ loc_package loc -- パッケージ名
putStrLn $ loc_module loc -- モジュール名
print $ loc_start loc -- ソースコード上のマクロの開始位置(行, 列)
module Main where
true :: a -> b -> a
true x _ = x
false :: a -> b -> b
false _ x = x
iF :: (a -> a -> a) -> a -> a -> a
iF b x y = b x y
@azu
azu / async-await-observable.md
Last active November 13, 2015 09:57
async/await、Rx、observableのECMAScript近況
@azu
azu / Incremental DOM.md
Last active July 13, 2022 16:07
Incremental DOM ざっと見たやつ。追記: 初期バージョンのコードなので最新では異なる場合があります。

Incremental DOM

Introducing Incremental DOM — Google Developers — Medium

Reactやvirtual-dom、Glimmer(Ember)などVirtual DOMの実装は色々あるが、これらのVirtual DOM実装には2つの問題がある

  • 既存のテンプレート言語を利用していない(しにくい)
  • モバイルでのパフォーマンス、特にメモリに関しては大きすぎる

これらを解決するためにIncremental DOMと言うものを作っている(WIP)

REM --source_map_location_mapping is case SENSITIVE !
REM need extra escaped double quote --source_map_location_mapping="\"C:/tools/closure/^|http://bla/\"" as per http://stackoverflow.com/a/29542669
java -jar compiler.jar --compilation_level=SIMPLE_OPTIMIZATIONS --create_source_map=C:\tools\closure\latest\maplayer.js.map --output_wrapper "%output%//# sourceMappingURL=maplayer.js.map" --js=C:\tools\closure\mapslayer.js --js_output_file=maplayer.min.js --source_map_location_mapping="\"C:/tools/closure/^|http://bla/\""
module Lib where
import Control.Lens
data Foo = Foo { a :: Int, b :: String, c :: Char } deriving Show
data Bar = Bar { x :: Int, y :: String } deriving Show
constructBar :: Lens Foo Foo Bar Bar
constructBar = lens getFoo2Bar setFooFromBar
getFoo2Bar :: Foo -> Bar
% rails g model m `ruby -e "801.times {|i| print %(c#{i} )}"` && rake db:migrate
% rails r 'p M.new.methods.length'
#=> 10000