Skip to content

Instantly share code, notes, and snippets.

View kesava's full-sized avatar

Kesava Mallela kesava

View GitHub Profile
@kesava
kesava / fiddle.css
Created August 14, 2014 08:15 — forked from zalun/fiddle.css
$fullred: #ff0000;
body {
font-family: Helvetica, Verdana
}
p {
padding: 7px 10px;
}
#demo {
border: 1px solid $fullred;
}
@kesava
kesava / fiddle.css
Last active August 29, 2015 14:05
Simple exercise to mockup Linkedin's miniprofile hover box. JSFiddle link: http://jsfiddle.net/gjy67g2g/
.miniprofile {
width: 450px;
height: 150px;
border: 1px solid #aaaaaa;
position: relative; /* all other elements styled relative to this section's position */
font-family: Arial;
}
.headshot {
margin: 10px;
float: left;
@kesava
kesava / brew list.txt
Created August 25, 2017 20:46
packages I use from homebrew
ack
adns
ant
antibody
aria2
asciinema
aspcud
autoconf
autojump
automake
@kesava
kesava / dis.clj
Created April 10, 2018 17:24
Distribution of `(rand)` function in clojure
(map (fn [[key value]] [key (count value)])
(group-by identity (take 6000000 (repeatedly #(str (rand-int 10))))))
;; (["9" 598517] ["3" 599137] ["4" 601005] ["8" 601573] ["7" 599983] ["5" 600287] ["6" 600611] ["1" 599224] ["0" 599582] ["2" 600081])
@kesava
kesava / random_color_str.clj
Created April 10, 2018 20:00
named colors
(def namedColors {
"aliceblue" "#f0f8ff",
"antiquewhite" "#faebd7",
"aqua" "#00ffff",
"aquamarine" "#7fffd4",
"azure" "#f0ffff",
"beige" "#f5f5dc",
"bisque" "#ffe4c4",
"black" "#000000",
"blanchedalmond" "#ffebcd",
@kesava
kesava / fold.js
Created April 20, 2018 20:46 — forked from jbmusso/fold.js
Functional acrobatics using folds in JavaScript.
/*eslint-env es6 */
// Inspired by the paper "A tutorial on the universality and
// expressiveness of fold" by Graham Hutton (available at
// http://www.cs.nott.ac.uk/~gmh/fold.pdf), implementing some generic
// list handling functions in JavaScript in terms of `fold`.
// Personally I had an enlightnening moment when I realised the
// beautiful interplay of cons lists and foldr during the FP101x
// Haskell course. JavaScript's syntax doesn't make this very apparent
class LazySeq {
constructor(low, high) {
this.low = low;
this.high = high;
}
head() {
return this.low;
}
@kesava
kesava / depth.js
Created February 17, 2019 18:37
Notate Depth in JS
var obj = {"isbn": "123-456-222",
"author":
{
"lastname": "Doe",
"firstname": "Jane"
},
"editor":
{
"lastname": "Smith",
"firstname": "Jane"
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@kesava
kesava / define-record.rkt
Last active September 4, 2020 00:37
define-record in racket macros
#lang racket
(require racket/syntax)
(require (for-syntax racket/syntax))
(require macro-debugger/expand)
(require syntax/parse/define)
(require
racket/stxparam
(for-syntax syntax/parse))
(define-syntax (define-record stx)