Skip to content

Instantly share code, notes, and snippets.

View shamansir's full-sized avatar

Ulric Wilfred shamansir

View GitHub Profile
@shamansir
shamansir / Main.purs
Created March 31, 2018 14:43 — forked from Gabriella439/Main.purs
Purescript Flare - Simon example
module Main where
import Data.Array ((..), reverse)
import Data.Int (toNumber)
import Flare (UI, radioGroup)
import Flare.Drawing (runFlareDrawing)
import Graphics.Drawing
import Graphics.Drawing.Font (font, sansSerif, bold)
import Math (cos, sin, pi)
import Prelude
@shamansir
shamansir / Main.purs
Created January 25, 2018 17:42 — forked from soupi/Main.purs
simple purescript-signal + purescript-canvas example
module Main where
import Prelude
import Data.Maybe
import Control.Monad.Eff
import Graphics.Canvas as C
import Signal as S
import Signal.DOM as S
@shamansir
shamansir / TestUtils.elm
Last active May 16, 2017 21:40 — forked from anonymous/Main.elm
iterateMap, iterateOr, iterateAnd, iterateMapAnd, iterateWhileAnd in Elm
module UtilsTest exposing (suite)
import Test exposing (..)
import Expect
import Utils exposing (..)
suite : Test
suite =
describe "utils"
autoload -U colors && colors
autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}•'
zstyle ':vcs_info:*' unstagedstr '%F{yellow}•'
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' enable git svn
theme_precmd () {
if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
// simple observer (pubsub) implementation
define(["underscore", "base/classex", "util/logging"], function(_, Class, Logging) {
var PubSub = Class.extend({});
PubSub._topics = function() {
if (!window.pubsub) {
window.pubsub = {};
}
return window.pubsub;
@shamansir
shamansir / Evolution of a Python programmer.py
Created September 2, 2012 12:13
Evolution of a Python programmer
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal