Skip to content

Instantly share code, notes, and snippets.

@eljojo
eljojo / 0_reuse_code.js
Created July 5, 2017 13:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@eljojo
eljojo / README.md
Created February 26, 2014 12:37 — forked from lucaong/README.md

ClosedStruct

A stupidly simple implementation of a kind of "sorta immutable" struct that can be instantiated as conveniently as an OpenStruct but after instantiation it doesn't let me (easily) add fields or mutate them:

guy = ClosedStruct.new( name: "John", age: 23 )

# readers:
guy.name             #=> "John"
guy.age #=> 23