Skip to content

Instantly share code, notes, and snippets.

@ctran
ctran / IOUtils.java
Created October 2, 2008 15:54
IOUtils.java
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.FileOutputStream;
import java.util.zip.GZIPOutputStream;
import java.util.zip.GZIPInputStream;
-- file: fctrl.hs
-- http://www.codechef.com/problems/FCTRL/
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_GHC -O2 #-}
module Main where
import qualified Data.ByteString.Char8 as S
import IO
main :: IO ()
set editing-mode vi
set blink-matching-paren on
set completion-ignore-case on
tab: complete
@ctran
ctran / y.clj
Created April 10, 2011 16:25
Y combinator.
defn Y
"Y combinator."
[f]
((fn [x]
(f (fn [y] ((x x) y))))
(fn [x]
(f (fn [y] ((x x) y))))))
(defn Y
"Y combinator."
@ctran
ctran / repl.clj
Created May 1, 2011 14:53
A simple Clojure repl.
(->> (read) (eval) (println) (while true))
(*
-------- WHAT THIS DOES --------
Enables you to externally open a specific file in eclipse, and go to some line
that is, makes a link with href of
openineclipse://open?url=file:///absolute/path/tofile.ext&line=5
open absolute/path/tofile.ext in eclipse
and go to line 5
@ctran
ctran / designer.html
Created June 29, 2014 07:35
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@ctran
ctran / hello.elm
Last active August 29, 2015 14:10
hello.elm
main : Element
main = plainText "Hello, World!"
@ctran
ctran / fizzbuzz.elm
Last active May 6, 2016 12:11
Fizz Buzz in elm
import Graphics.Element (Element, flow, down)
import List (map)
import Text (asText)
main : Element
main =
let fizzBuzz n = case (n % 3, n % 5) of
(0, 0) -> "FizzBuzz"
(0, _) -> "Fizz"
(_, 0) -> "Buzz"
import Graphics.Element (..)
import Html (..)
import Html.Attributes (..)
import Html.Events (..)
import Html.Lazy (lazy, lazy2)
import Json.Decode as Json
import List
import Maybe
import Signal
import String