Skip to content

Instantly share code, notes, and snippets.

@GMali
GMali / es6-extension.js
Created October 25, 2016 23:17
Accessing ES6 getters
// For question: http://stackoverflow.com/questions/40249605/how-do-i-get-the-result-of-class-getters-into-json
function getMethodNames(obj) {
return Object.getOwnPropertyNames(obj.constructor.prototype);
}
function isGetter(obj, method) {
let desc = Object.getOwnPropertyDescriptor(obj.constructor.prototype, method);
return !!desc.get;
}
@GMali
GMali / Lost in the Desert
Created May 26, 2016 04:26
The Longest Joke in the World
Duplicating this Joke from http://longestjokeintheworld.com/ because it's easier to read and share it via a Gist. Please go to the original site after reading this and scroll to the bottom.
---
So, there's a man crawling through the desert.
He'd decided to try his SUV in a little bit of cross-country travel, had great fun zooming over the badlands and through the sand, got lost, hit a big rock, and then he couldn't get it started again. There were no cell phone towers anywhere near, so his cell phone was useless. He had no family, his parents had died a few years before in an auto accident, and his few friends had no idea he was out here.
He stayed with the car for a day or so, but his one bottle of water ran out
and he was getting thirsty. He thought maybe he knew the direction back, now that he'd paid attention to the sun and thought he'd figured out which way was north, so he decided to start walking. He figured he only had to go about 30 miles or so and he'd be back to the small town he'd gotten gas i
@GMali
GMali / Makefile for Java Apps
Created February 9, 2012 17:04
Simply type "make app" to clean, build and run your Java app.
build:
javac */*.java
run:
java app.Browser
clean:
rm */*.class
app: clean build run