Skip to content
View variable.rb
if false
x = 1
puts "x: #{x.inspect}" #=> x: nil
View sum.hs
-- How to run
-- $ git log --numstat --pretty="%0" |grep -v "%0" | runhaskell sum.hs
import Control.Applicative
import Data.Map (Map)
import qualified Data.Map as Map
import System.IO
import Text.Read
import Data.List
task :compile do
`pandoc -t slidy -s -o slide.html`
task :open do
`open slide.html`
task :watch do
require 'listen'
View git_log.rb
require 'sinatra'
get '/log' do
"<html><body>#{ `git log --format="<p>%h %an %ad %s</p>"` }</body></html>"
View QueryDocument.hs
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
module MongoDB.QueryDocument where
import Data.List (intercalate)
import Data.Monoid
import Data.Set
import Prelude hiding (map)
import qualified Prelude
View Ls.hs
module S3.Ls
( ls
) where
import Control.Applicative ((<*))
import Control.Exception (throwIO)
import System.Process (readProcessWithExitCode)
import Text.Parsec
import Text.Parsec.String
Q = require 'q'
total = 0
delay = (ms) =>
deferred = Q.defer()
setTimeout( =>
total = total + ms
console.log "Delayed #{ms} msec. Spent #{total} msec."
View sort_csv.hs
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Monad.ST
import qualified Data.ByteString.Lazy as BL
import Data.Csv
import Data.List (intercalate)
import qualified Data.Vector as V
import qualified Data.Vector.Algorithms.Intro as VA
View cabal.hs
import Distribution.PackageDescription.Parse (readPackageDescription)
import Distribution.PackageDescription.PrettyPrint (showGenericPackageDescription)
import Distribution.Verbosity (silent)
-- Taken from Thanks @magthe
main = do
gpd <- readPackageDescription silent "hi.cabal"
putStrLn $ showGenericPackageDescription gpd
View z-index.css.scss
@mixin stack-classes ($classes) {
$i: 10;
@each $class in $classes {
.#{$class} {
z-index: $i;
$i: $i + 10;
Something went wrong with that request. Please try again.