Skip to content

Instantly share code, notes, and snippets.

Sudaraka Wijesinghe sudaraka

Block or report user

Report or block sudaraka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View y-combinator.js
#!/usr/bin/env node
/**
* Following code samples and notes are from my following of Jim Weirich's
* presentation "Y Not? Adventures in Functional Programming"
*
* http://confreaks.tv/videos/rubyconf2012-y-not-adventures-in-functional-programming
* https://www.youtube.com/watch?v=FITJMJjASUs
*
* Note: presentation was done using Ruby, while my code sample are in
@sudaraka
sudaraka / compose.js
Last active Sep 8, 2017
General purpose JavaScript compose function
View compose.js
/**
* compose.js: compose function & usage
*
* Copyright 2017 Sudaraka Wijesinghe <sudaraka@sudaraka.org>
*
* This program comes with ABSOLUTELY NO WARRANTY;
* This is free software, and you are welcome to redistribute it and/or modify
* it under the terms of the BSD 2-clause License. See the LICENSE file for more
* details.
*
@sudaraka
sudaraka / deep-freeze.js
Created Sep 18, 2016
Deep freeze an object
View deep-freeze.js
/**
* deep-freeze.js: Deep freeze an object
*
* Copyright 2016 Sudaraka Wijesinghe <sudaraka@sudaraka.org>
*
* This program comes with ABSOLUTELY NO WARRANTY;
* This is free software, and you are welcome to redistribute it and/or modify
* it under the terms of the BSD 2-clause License. See the LICENSE file for more
* details.
*
View automata.js
(function() {
'use strict'
const
MEMBERS = 181,
GENERATIONS = 100,
randomState = () => Math.random() > .5,
createCell = () => {
View index.html
<html>
<head>
<style>
.expandinginput {
position: relative;
border: 1px solid #888;
background-color: #fff;
}
.expandinginput textarea,
View monad.js
const
R = require('ramda'),
fs = require('fs')
// == Maybe ====================================================================
const
Maybe = function(x) {
this.__value = x
}
View keybase.md

Keybase proof

I hereby claim:

  • I am sudaraka on github.
  • I am sudaraka (https://keybase.io/sudaraka) on keybase.
  • I have a public key whose fingerprint is 6C7A AFF5 A094 0D99 4024 7706 3D3C 830F E563 ECEE

To claim this, I am signing this object:

You can’t perform that action at this time.