Skip to content

Instantly share code, notes, and snippets.

View Demonstrandum's full-sized avatar

Samuel Demonstrandum

View GitHub Profile
@ayosec
ayosec / highlight_word_under_cursor.vim
Created November 15, 2012 03:02
Vim: Highlight word under cursor
" When the cursor is hold on a word, that word is highlighted.
" When the cursor is moving, the highlight is hidden
set updatetime=300
au! CursorMoved * set nohlsearch
au! CursorHold * set hlsearch | let @/='\<'.expand("<cword>").'\>'
set hlsearch
@h2non
h2non / ancestors.js
Created February 6, 2015 18:55
Recursively inspect the prototype chain inheritance of a given object in JavaScript (inspired in Ruby's Class.ancestors)
// Under WTFPL license ;)
function ancestors(obj) {
var hierarchy = [];
if (['boolean', 'number', 'string', 'undefined'].indexOf(typeof obj) !== -1 || obj === null) { // primitives types
obj = Object(obj);
} else if (typeof obj === 'function') {
hierarchy.push(
obj.name ||
(obj.toString().match(/function (\w*)/) ||
obj.toString().match(/\[object (\w*)\]/))[1] ||
@bangedorrunt
bangedorrunt / rust_functor.rs
Last active March 3, 2020 10:05 — forked from srijs/rust-functor.rs
Rust Functor
use std::boxed::Box;
use std::option::Option;
use std::result::Result;
use Maybe::*;
#[derive(Debug, PartialEq, Eq)]
enum Maybe<T> {
Nothing,
Just(T),
}
@jdan
jdan / y
Last active May 22, 2020 17:51
(λ (f)
((λ (x) (f (x x)))
(λ (x) (f (x x)))))
@Demonstrandum
Demonstrandum / catbread.gif
Last active December 22, 2021 17:52
Bread
catbread.gif
Uptime: 4 days, 2 hours, 50 minutes
* TODO Simp'o'matic: Commands to implement
- [-] .cron
- [-] parse cron's official syntax
- [X] step values (/)
- [ ] range of values (-)
- [ ] limit ranges (hours: [0, 24], months: [0, 30/31])
- [X] any value (*)
@divs1210
divs1210 / stackless-eval.md
Last active April 22, 2024 01:58
Writing a Stackless Evaluator

Writing a Stackless Evaluator

Divyansh Prakash, September 2023

tiny-stackless-eval

Preface

NOTE: Please read the previous post to understand the context of this post.