Skip to content

Instantly share code, notes, and snippets.

stoffie / app.js
Last active November 30, 2016 07:03
View app.js
(function(undefined) {
// @note
// A few conventions for the documentation of this file:
// 1. Always use "//" (in contrast with "/**/")
// 2. The syntax used is Yardoc (, which is intended for Ruby (se below)
// 3. `@param` and `@return` types should be preceded by `JS.` when referring to
// JavaScript constructors (e.g. `JS.Function`) otherwise Ruby is assumed.
// 4. `nil` and `null` being unambiguous refer to the respective
// objects/values in Ruby and JavaScript
// 5. This is still WIP :) so please give feedback and suggestions on how
stoffie / lose.exec
Created November 24, 2016 18:35
I lost it
View lose.exec
damiano@Z97P-D3:~/SE2_166312_MealManager$ PORT=3000 sails lift
info: Starting app...
Excuse my interruption, but it looks like this app
does not have a project-wide "migrate" setting configured yet.
(perhaps this is the first time you're lifting it with models?)

Password slides: pato

stoffie /
Last active October 4, 2016 09:55
// This code is editable, feel free to hack it!
// You can always return to the original code by clicking the "Reset" button ->
// Regex abstract syntax tree
#[derive(Debug, PartialEq)]
enum ReAst {
Seq(Box<ReAst>, Box<ReAst>),
Pipe(Box<ReAst>, Box<ReAst>),
View gist:f8cbc1c434f62a9981f21d5130c613f1
View scaffold.css
:root {
--black: black;
--white: white;
--red: #05e;
--green: red;
body {
background-color: var(--red);
color: var(--white);
# method resolution order
class A:
def foo(self):
class B(A):
def foo(self):
xrandr --output DVI-D-0 --mode 1920x1080 --rate 144
xmodmap -e "pointer = 3 2 1"
stoffie / basic.rb
Last active January 13, 2016 21:34
View basic.rb
# Return a string of greeting
def welcome_message
def test_welcome_message
assert_equal "Hello, World!", welcome_message
# Implement the factorial function
View problems.rb
# Find the longest string in a vector
# Count the number of upcased letter in a string
# Reverse an hash inside out, ie:
# {a: :b} becomes {b: :a}
# Find if an array has nested arrays
# Find how deep an array is, ie how many arrays are nested in it