This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# Author: Dan Q (dan@scatmania.org) | |
# More information: http://www.scatmania.org/?p=4600 | |
# | |
# This program is free software. It comes without any warranty, to | |
# the extent permitted by applicable law. You can redistribute it | |
# and/or modify it under the terms of the Do What The Fuck You Want | |
# To Public License, Version 2, as published by Sam Hocevar. See | |
# http://sam.zoy.org/wtfpl/COPYING for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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.'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>target="_blank" vulnerability demo</title> | |
<style> | |
body { | |
margin: 0; | |
overflow: hidden; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 _____ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>YouTube Video Wall</title> | |
<style type="text/css"> | |
body { | |
margin: 0; | |
background: black; | |
color: white; |
OlderNewer