Skip to content

Instantly share code, notes, and snippets.

@vampjaz
vampjaz / countdown.py
Last active November 25, 2016 11:43
FRC countdown - python countdown.py <unix timestamp>
import time
from Tkinter import *
import sys
END = int(sys.argv[1]) # epoch in seconds
RATE = 50
font1 = ("Helvetica", 30, 'bold')
font2 = ("Helvetica", 28)
root = Tk()
@vampjaz
vampjaz / 100.th
Created May 22, 2016 16:05
Thue solutions - lines starting with a space are comments
ab=ba;
that was easy
@vampjaz
vampjaz / 20160521.log
Created May 23, 2016 18:04
most of #defconctf irc for the 2016 comp
[09:53:51] *** Joins: nwx ([email protected])
[09:54:09] *** Joins: WebIRC22009 ([email protected])
[09:54:54] *** Quits: Lightning ([email protected]) (Client Quit)
[09:56:11] *** Quits: mightym0 ([email protected]) (Ping timeout: 252 seconds)
[09:56:18] <nwx> ಠ_ಠ
[09:57:22] *** Quits: IceGuest_78 ([email protected]) (Ping timeout: 252 seconds)
[10:01:31] *** Joins: lurcifer (~a29@2601:143:4202:ba5c:a8d0:d4ca:365e:2968)
[10:03:57] *** Quits: lurcifer (~a29@2601:143:4202:ba5c:a8d0:d4ca:365e:2968) (Client Quit)
[10:05:14] *** Quits: WebIRC31809 ([email protected]) (Client Quit)
[10:06:43] <TMT> how much we should watch time_sink ? :))
@vampjaz
vampjaz / mac_apps.txt
Created February 13, 2018 04:03
Mac apps every one needs (some oriented toward develpers)
- Google chrome
- Sublime Text
- Clover configurator
- CPU LED
- Discord
- GIMP
- HandBrake
- iMovie
- Inventor Fusion (not the 360 version if you can get it)
- Itsycal
@vampjaz
vampjaz / hs_error_pid7498.log
Created February 17, 2018 23:49
segfault in Pathfinder
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xb6dd1824, pid=7498, tid=0xb52e7470
#
# JRE version: OpenJDK Runtime Environment (8.0_131-b57) (build 1.8.0_131-b57)
# Java VM: OpenJDK Client VM (25.131-b57 mixed mode, Evaluation linux-aarch32 )
# Problematic frame:
# C [libc.so.6+0x5b824] fwrite+0x18
#
@vampjaz
vampjaz / main.py
Created February 25, 2018 10:33
example usage of a SydDiscord + Dogecord bot
from SydDiscord import Discord
from dogecord import BotFramework
## here would probably be where we load the secret keys, configuration, and such
dc = Discord(authentication thingies)
bot = BotFramework(dc, config_stuff) # the config would point to a module folder
bot.load_modules()
if __name__ == '__main__':
@vampjaz
vampjaz / algebra.py
Created March 19, 2018 18:38
Python (2) solver for real roots of a polynomial
## python algebra module
import math
def func_in(func,var='x'): ## lowercase var to split on
# returns a list of the coefficients
func = func.replace('-','+-').lower().replace(' ','')
lst2 = {}
try:
for term in func.split('+'):
@vampjaz
vampjaz / gifconv.sh
Created April 30, 2018 21:13
makes still pngs into a still gif (for nitro emote server packing)
#!/bin/sh
## all the input files should be png files in the current directory
# dependencies: imagemagick convert utility
mkdir -p temp
mkdir -p output
for file in *.png
do echo "Converting $file"
@vampjaz
vampjaz / mcmeta_anim.py
Last active June 2, 2018 21:43
Reads a Minecraft texture file and its accompanying .mcmeta file and generates the specified animation
# depends on Pillow/PIL and ImageMagick's `convert' utility
from PIL import Image
import json
import sys
import os
import tempfile
import shutil
# specify the image file (not the mcmeta file) as the first argument
@vampjaz
vampjaz / betterscrollbar.pde
Created July 30, 2018 21:18
A nice scrollbar implementation for Processing
class ScrollBar {
float x,y,w,h;
float min,max,val;
String name;
ScrollBar(float xp, float yp, float sw, float sh, float lo, float hi, float v, String n) {
x=xp;
y=yp;
w=sw;
h=sh;