Skip to content

Instantly share code, notes, and snippets.

@luigy
luigy / Main.hs
Last active June 22, 2017 23:38
different behavior with ghcjs vs ghc(jsaddle-warp)
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad
import Reflex.Dom
main :: IO ()
main = run $ mainWidget' $ do
(outer, inner) <- el' "div" $ do
elStopPropagationNS Nothing "div" Click $ do
@luigy
luigy / gist:2e1355035f01f9442cb66a3c1c696f70
Created June 22, 2017 23:19
different behavior with ghcjs vs ghc(jsaddle-warp)
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad
import Reflex.Dom
main :: IO ()
main = run $ mainWidget' $ do
(outer, inner) <- el' "div" $ do
fmap leftmost $ forM ["FOO", "BAR"] $ \l -> do
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}
{-
start 10000 threads that each randomly update the color of a single cell in a table
-}
module Main where
import Control.Concurrent
import Control.Monad
@luigy
luigy / gist:8637084
Created January 26, 2014 18:25
tern errors
error in process sentinel: tern-req-finished: Invalid function: (:error (error connection-failed "failed with code 22
" :host "127.0.0.1" :service 62226) . #[514 "rÁqˆƒ'@A@Å=ƒ'¢„'ÂÆ ˆ ÇÈâ\"²‚+À\")‡" [#[514 " ÂW…C„7≃2‰@ÆžAǚƒ+rÈÉÊžA
\"!qˆË)A¶‚‚ ˆÀ!‡ÁÌ=?…CÍÎA\"‡" [#[257 "Â!‰…
ÀBà ‡" [50 tern-last-argument-hints tern-parse-function-type tern-show-argument-hints] 4 "
(fn DATA)"] :silent 2 ((((type . "full") (text . #("var React = require('react');
var test = require('
...
@luigy
luigy / vim.rb
Last active December 25, 2015 10:59
fix 'sigaltstack' compilation error on 10.9 fix by @felixbuenemann https://github.com/mxcl/homebrew/pull/2047 On Mavericks we need to explicitly include AvailabilityMacros.h to have the version detection macros defined.
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
# This package tracks debian-unstable: http://packages.debian.org/unstable/vim
url 'http://ftp.debian.org/debian/pool/main/v/vim/vim_7.4.052.orig.tar.gz'
sha1 '216ab69faf7e73e4b86da7f00e4ad3b3cca1fdb8'
head 'https://vim.googlecode.com/hg/'