Skip to content

Instantly share code, notes, and snippets.

View igrep's full-sized avatar
:shipit:
Writing in Haskell or TypeScript.

YAMAMOTO Yuji igrep

:shipit:
Writing in Haskell or TypeScript.
View GitHub Profile
@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
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
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/\""
@azu
azu / async-await-observable.md
Last active November 13, 2015 09:57
async/await、Rx、observableのECMAScript近況

Create a tunnel to github with the git default daemon port like this:

$ ssh -L9418:github.com:9418 myuser@myhomessh.com

And clone repositories replacing github.com with localhost, like so:

$ git clone git://localhost/someuser/someproject.git

If you want to preserve the “correct” metadata, there are several options

@drinkcat
drinkcat / PKGBUILD
Last active December 23, 2015 14:19
ruby-rmagick new PKGBUILD. Patch from https://github.com/bricef/rmagick/commit/689271fbb439dbf735f120811ac3b2dc79ba95a2 It seems to work for simple cases (at least we can compile and use rmagick), no idea how badly HDR images handling is broken.
# Contributor: Alexsandr Pavlov <kidoz at mail dot ru>
pkgname=ruby-rmagick
_gemname=${pkgname#ruby-}
pkgver=2.13.2
pkgrel=2
pkgdesc="Interface between the Ruby programming language and the ImageMagick"
arch=('i686' 'x86_64')
url="http://rmagick.rubyforge.org"
license=(MIT)
depends=('ruby' 'imagemagick' 'rubygems')