Skip to content

Instantly share code, notes, and snippets.

@finnbar
finnbar / generateCards.rb
Created August 31, 2017 12:51
Mega Space Cards
#!/usr/bin/ruby
require 'squib'
#Squib::logger.level = Logger::DEBUG
# Need to modify Merge Module to be a sensible length, or shrink font.
keywords = ["Standard Part", "tech strength range", "send", "merged", "merge", "docked", "destroyed", "destroys", "destroy", "trashing", "trashed", "trashes", "trash", "carry", "carried", "Malicious AI (1)", "Malicious AI (2)", "Malicious AI (3)", "Sticky (2)", "Sticky (4)", "scatters", "scattered", "scatter", "focused", "strength"]
htmlescape = [["&", "&amp;"], ["'", "&apos;"], ["\"", "&quot;"], ["<", "&lt;"], [">", "&gt;"]]
@finnbar
finnbar / randomNetrunnerCard2.py
Created June 29, 2017 10:29
Pick random Netrunner cards from a given set of pack codes.
import json, urllib2, random
def getPacks():
# Make an array mapping pack_code to full name.
packCodeToName = {}
packsJSON = urllib2.urlopen("https://netrunnerdb.com/api/2.0/public/packs")
packs = json.loads(packsJSON.read().decode("utf-8"))["data"]
for pack in packs:
packCodeToName[pack["code"]] = pack["name"]
return packCodeToName
@finnbar
finnbar / testscript.js
Created February 10, 2017 13:49
A script to check for XSS-type stuff
alert("Hmm, this is bad");
@finnbar
finnbar / index.html
Created December 29, 2015 14:26
Pretty lsystem generator! Just open in your browser and it works.
<html>
<head>
<title>lsystems, go!</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.4/p5.js"></script>
<script type="text/javascript" src="lsystems.js"></script>
<script type="text/javascript" src="jscolor.js"></script>
<style type="text/css">
#mycanvas {
float: left;
border-style: solid;
@finnbar
finnbar / errors.txt
Last active August 29, 2015 14:18
OCTGN Errors in Elementary OS
(a bunch of SSL - Ignoring SSL messages)
--
INFO 2015-04-06 21:08:05,249 3.1.160.353 [17] Octgn.Utils.SSLValidationHelper [(null)] - SSL Request
INFO 2015-04-06 21:08:05,252 3.1.160.353 [17] Octgn.Utils.SSLValidationHelper [(null)] - Ignoring SSL Validation
WARN 2015-04-06 21:08:11,342 3.1.160.353 [18] Octgn.Networking.ClientSocket [(null)] - EndReceive
System.Net.Sockets.SocketException (0x80004005): Not enough memory
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at Octgn.Library.Networking.SocketBase.EndReceive(IAsyncResult res) in c:\Program Files (x86)\Jenkins\workspace\OCTGN-Release\octgnFX\Octgn.Library\Networking\SocketBase.cs:line 157
@finnbar
finnbar / c00lstuff.html
Created November 29, 2014 15:32
Social Media - Weekday Correlation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Notebook</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
@finnbar
finnbar / conf.moon
Created March 11, 2014 19:23
Moonscript Pascal's Triangle Shader
love.conf = (t) ->
t.window.height=850
t.window.width=1000
@finnbar
finnbar / survivalpacman.ino
Created January 13, 2014 21:25
NEW DIY GAMER GAME! "Survival Pacman" Try to dodge the ghost that follows you (erratically)! The more you move, the more you score! With added Ghost AI and score counting up to 999999! (trust me, you'll never get that far)
#include <SoftwareSerial.h>
#include <Gamer.h>
Gamer gamer;
int posX=0;
int posY=0;
int ghostX=7;
int ghostY=7;
int dir=1;
@finnbar
finnbar / THE BE NICE LICENSE
Last active December 21, 2015 21:48
If only licenses were a bit more like this...
This code is put under my personal "be nice" license:
== THE BE NICE LICENSE ==
1) You may use this however you wish, although credit would be nice. It'd also be nice to see this license and my name on all derivatives.
2) Statement 1 is declared void if you are a nasty person.
2.5) If statement 1 is void, ALL RIGHTS ARE RESERVED YOU NASTY PERSON.
3) That's it.
===