I hereby claim:
- I am Dan-Q on github.
- I am dq (https://keybase.io/dq) on keybase.
- I have a public key whose fingerprint is B00A 55DA C3F5 9B51 7CA3 F64F 6342 1D24 3218 A6AC
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
# | |
# Run in a directory containing any number of XML files from the EEBO-TCP project, | |
# which can be acquired via Github at https://github.com/textcreationpartnership, | |
# among other ways. It uses the Nokogiri XML parser to perform frequency counts of | |
# each of the selected features (specified in CSS3 syntax) and outputs the result | |
# to a HTML table (by default, called "output.html"). | |
# | |
# Thrown together quickly for the EEBO-TCP Hackathon at the Weston Library in Oxford | |
# in March 2015, as described at https://danq.me/2015/04/22/eebo-tcp-hackathon, this |
#!/usr/bin/env ruby | |
# Grimesweeper | |
# Calculates the victory chances if different combinations of Grime Dice (non-transitive dice) against one another | |
# Inspired by https://protonsforbreakfast.wordpress.com/2013/01/08/amazing-dice-rediscovering-surprise/ | |
# Discussed on http://www.reddit.com/r/tabletopgamedesign/comments/1aibz9/grime_dice_might_make_a_good_basis_for/ | |
# More info: http://grime.s3-website-eu-west-1.amazonaws.com/ | |
class DiceSet < Array | |
# Returns an array of all of the possible outcome totals of throwing this DiceSet | |
def outcomes |
#!/usr/bin/env ruby | |
# -*- coding: iso-8859-1 -*- | |
# Inspired by http://datagenetics.com/blog/april12012/index.html | |
# Comes up with the "hardest words" to guess, in hangman, assuming the player is playing optimally | |
# (choosing the letter most-likely to appear, given a dictionary of all candidate words and the | |
# letters guessed so far [because hangman guesses are not independent; they affect the gamestate | |
# either by saying "this letter DOES NOT feature" or by saying "this letter features in THESE | |
# positions"]) | |
# Result: a "hardest hangman words" dictionary? |
<?php | |
if(isset($_POST['submit'])) { | |
$save_result = file_put_contents('settings.ini', | |
array("[prompter]", "\n", | |
"text_size=", $_POST['text_size'], "\n", | |
"text_colour=", $_POST['text_colour'], "\n", | |
"text_speed=", $_POST['text_speed'], "\n", | |
"container_height=", $_POST['container_height'])); | |
if($save_result === false) die('Failed to save settings: check write permission on settings.ini.'); | |
} |
#!/bin/bash | |
# Concrete5 Console<?php /* | |
cd `dirname $0` | |
php -dauto_prepend_file=`basename "$0"` -a | |
cd - | |
exit | |
*/ | |
define('DIR_BASE','.'); | |
define('C5_ENVIRONMENT_ONLY',true); | |
include('index.php'); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>target="_blank" vulnerability demo</title> | |
<style> | |
body { | |
margin: 0; | |
overflow: hidden; | |
} |
msg = "Your message goes here." | |
[true, false].each{|x|puts msg.split(' ').map{|w|(x = !x) ? w : ('_'*w.length)}.join(' ')} | |
# Result: | |
# ____ message ____ here. | |
# Your _______ goes _____ |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>YouTube Video Wall</title> | |
<style type="text/css"> | |
body { | |
margin: 0; | |
background: black; | |
color: white; |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
CHARS = %w{ } | |
def encode(string) | |
string.chars.map{|c|"#{CHARS[c[0]/16]}#{CHARS[c[0]%16]}"}.join | |
end | |
program = <<-EOF |