Skip to content

Instantly share code, notes, and snippets.

-- Return the absolute value of a number.
-- e.g. `abs(-14)` returns `14`, `abs(7)` returns 7.
on abs(theNumber)
if theNumber is less than 0 then return -theNumber
return theNumber
end abs
-- Splits `theString` by a provided delimiter.
-- e.g. `split("4:3", ":")` returns {"4", "3"}
on split(theString, theDelimiter)

Gloomhaven Party Changes

Party

  • Road Event #9 moved to bottom
  • Road Event #10 removed from game
  • City Event #10 moved to bottom
  • City Event #11 removed from game
  • City Event #71 added to game.
  • Completed Scenarios: Ruinous Crypt (#5) and Investigation (#57)
  • Opened Treasures #3, #4, #22, #28
  • Reputation: -1 (Total: 2, Price Modifier: 0)
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const url = require("url");
const express = require("express");
const next_1 = require("next");
const dev = process.env.NODE_ENV !== 'production';
const app = next_1.default({ dev });
const handle = app.getRequestHandler();
app.prepare()
.then(() => {
#############
# NOTE TAKING
function n() {
NAME=$1
if [[ "$NAME" != *.md ]]; then
NAME="${NAME}.md"
fi
${NOTES_EDITOR:-$EDITOR} "${NOTES_DIR:-$HOME/.notes}/$NAME"
@Dru89
Dru89 / word_bubbles_solver.py
Created May 28, 2015 06:39
A simple(ish) script written in python to solve puzzles for the Word Bubbles game. I hacked on this for about a day, so I'm not sure how well it works.
import argparse
import os
import re
import sys
from collections import defaultdict, Counter
from copy import deepcopy
EXAMPLE_PUZZLE = [
['n', 'e', 'e', 't'],
@Dru89
Dru89 / coffeelint.json
Created December 27, 2014 21:33
The SASS and CoffeeScript linting files that I use
{
"no_backticks": {
"level" : "ignore"
},
"no_tabs" : {
"level" : "error"
},
"no_trailing_whitespace" : {
@Dru89
Dru89 / turtles.py
Created September 4, 2014 21:47
Get all the images from http://xkcd.com/1416/
# Get all the images from http://xkcd.com/1416/
import urllib2
import json
ids = []
def process(id):
if id in ids: return
ids.append(id)
@Dru89
Dru89 / prose.zsh-theme
Created July 10, 2014 20:04
My ZSH Theme
# Most of this was taken from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
# Determine what character to use in place of the '$' for my prompt.
function repo_char {
git branch >/dev/null 2>/dev/null && echo '☿' && return
echo '○'
}
# Display any virtual env stuff with python.
function virtualenv_info {
ORIGIN_GIT_REPO=/path/to/my/origin/repo.git
###############################
# Method 1: You don't care if the clone is a repo, you just want the files
# (useful for builds/etc that you aren't manually working with)
TMP_GIT_CLONE=/path/to/local/clone
git clone $GIT_REPO $TMP_GIT_CLONE
# if you do some build logic, it could go here like:
# cd $TMP_GIT_CLONE/
module Jekyll
LIQUIDY_TAGS = ['{{', '}}', '{%', '%}']
class StaticFile
def is_liquidy
case File.extname(self.path)
when '.html'
text = File.read(self.path)
LIQUIDY_TAGS.any? { |tag| text.include? tag }
else