View variable.rb
1 2 3 4 5
if false
x = 1
end
 
puts "x: #{x.inspect}" #=> x: nil
View sum.hs
1 2 3 4 5 6 7 8 9 10
-- 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
View Rakefile
1 2 3 4 5 6 7 8 9 10
task :compile do
`pandoc -t slidy -s edtech_cto_night.md -o slide.html`
end
 
task :open do
`open slide.html`
end
 
task :watch do
require 'listen'
View git_log.rb
1 2 3 4 5
require 'sinatra'
 
get '/log' do
"<html><body>#{ `git log --format="<p>%h %an %ad %s</p>"`.each_line.map(&:chomp).join }</body></html>"
end
View QueryDocument.hs
1 2 3 4 5 6 7 8 9 10
{-# 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
1 2 3 4 5 6 7 8 9
module S3.Ls
( ls
) where
 
import Control.Applicative ((<*))
import Control.Exception (throwIO)
import System.Process (readProcessWithExitCode)
import Text.Parsec
import Text.Parsec.String
View q.coffee
1 2 3 4 5 6 7 8 9 10
Q = require 'q'
 
total = 0
delay = (ms) =>
deferred = Q.defer()
setTimeout( =>
total = total + ms
console.log "Delayed #{ms} msec. Spent #{total} msec."
deferred.resolve()
View sort_csv.hs
1 2 3 4 5 6 7 8 9 10
{-# 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
1 2 3 4 5 6 7 8 9
import Distribution.PackageDescription.Parse (readPackageDescription)
import Distribution.PackageDescription.PrettyPrint (showGenericPackageDescription)
import Distribution.Verbosity (silent)
 
-- Taken from http://therning.org/magnus/archives/514. Thanks @magthe
 
main = do
gpd <- readPackageDescription silent "hi.cabal"
putStrLn $ showGenericPackageDescription gpd
View z-index.css.scss
1 2 3 4 5 6 7 8 9
@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.