Skip to content

Instantly share code, notes, and snippets.

@pfirpfel
pfirpfel / splitcube.tsv
Created October 22, 2012 15:47
pfirpfel's splitcard-cube as tab-seperated list
Tundra Mirrorweave
Underground Sea Undermine
Badlands Blightning
Taiga Artifact Mutation
Savannah Aura Mutation
Scrubland Zealous Persecution
Volcanic Island Prophetic Bolt
Bayou Maelstrom Pulse
Tropical Island Aether Mutation
Plateau Master Warcraft
@pfirpfel
pfirpfel / ArrayIterator.java
Created October 31, 2012 14:53
Generic Array Iterator
package pfirpfel;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class ArrayIterator<E> implements Iterator<E> {
private E[] array;
private int index = 0;
private boolean lastRemoved = false;
public class QuickSortMSP {
private static int noOfSwaps = 0;
public static void main(String[] args) {
int arr[] = {5,5,5,5,5};
sort(arr);
System.out.print("Swaps: "+noOfSwaps);
}
public static void sort(int[] arr){
public class MaxThreads {
private static int count = 0;
public static void main (String[] args){
while(true){
Thread t = new Thread(new T(), ++count + "");
t.start();
System.out.println(count + "");
}
@pfirpfel
pfirpfel / gist:6852663
Last active December 24, 2015 19:39
Processing Chessboard 12x12 with funky colors
void setup(){
size(480,480);
frameRate(64);
for(int x = 0; x < 8; x++){
for(int y = 0; y < 8; y++){
if((x+y)%2 == 0){
fill(255);
} else {
fill(0);
}
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
@pfirpfel
pfirpfel / battle_box.txt
Last active August 29, 2015 14:19
Battle Box
# White (40)
Loam Lion
Hopeful Eidolon
Loyal Cathar
Leonin Relic-Warder
Knight of Cliffhaven
Kor Skyfisher
Dauntless River Marshal
Hidden Dragonslayer
Flickerwisp
@pfirpfel
pfirpfel / polyominoes.js
Last active August 29, 2015 14:22
Challenge #218 [Intermediate] Generating Polyominoes
/**
* Polyomino
*/
function Polyomino(){
this.points = [];
}
Polyomino.prototype.print = function(){
var allX = this.points.map(function(p){ return p.x; });
var allY = this.points.map(function(p){ return p.y; });
@pfirpfel
pfirpfel / pair_round_robin.js
Created April 27, 2016 13:11
Round Robin Pairings
var players = ['A', 'B', 'C', 'D', 'E', 'F', 'G' ];
var generateRounds = function(players, bye){
// add bye to rotation if number of players is odd
if(players.length % 2 == 1){
players.push(bye);
}
// first player does not rotate
var first = players.shift();
@pfirpfel
pfirpfel / index.html
Last active April 20, 2021 12:42
[HTML5 Canvas] Clip-Mask
<html>
<head>
<title>Canvas Clip Mask</title>
</head>
<body>
<input id="karma" type="range" min="0" max="100" value="50" style="width: 500px;"/>
<br>
<canvas id="canvas"></canvas>
<script src="knot.js" type="text/javascript"></script>
<script src="main.js" type="text/javascript"></script>