Skip to content

Instantly share code, notes, and snippets.

@1328
1328 / ximmer2.py
Created September 30, 2015 22:51
ximmer2.py
from __future__ import absolute_import, division, print_function
# might make this work on py2
from builtins import *
# Copyright (c) 2014, Varian Medical Systems, Inc. (VMS)
# All rights reserved.
#
# ximReader is an open source tool for reading .xim file (both compressed and uncompressed)
# HND compression algorithm is used to compress xim files. For a brief description of HND
# compression algorithm please refer to the xim_readme.txt file.
@1328
1328 / cars.py
Created April 11, 2016 17:08
cars
import numpy as np
from itertools import product
from random import shuffle,random
def blank_road(**args):
lanes, cells = args['lanes'], args['cells']
return np.zeros((lanes, cells))
@1328
1328 / ximmer.py
Created September 30, 2015 14:47
xim fix
from __future__ import absolute_import, division, print_function
# might make this work on py2
from builtins import *
# Copyright (c) 2014, Varian Medical Systems, Inc. (VMS)
# All rights reserved.
#
# ximReader is an open source tool for reading .xim file (both compressed and uncompressed)
# HND compression algorithm is used to compress xim files. For a brief description of HND
# compression algorithm please refer to the xim_readme.txt file.
@1328
1328 / h2,py
Created March 18, 2015 21:32
hangman
import random
from string import ascii_lowercase
# a bit of a hacky solution to change the board names to be a bit better
from boards import easy as easy_board
from boards import hard as hard_board
WORD_FILENAME = 'wordlist.txt'
@1328
1328 / parse_keybag.py
Last active February 5, 2020 13:12 — forked from geekman/parse_keybag.py
extract & parse the BackupKeyBag from an iTunes Backup
from __future__ import print_function
# updated to work with py3 using only standard lib modules
# unsure if it will work with py2 still...
import plistlib
import struct
import sys
from binascii import hexlify
@1328
1328 / x.py
Last active February 5, 2019 16:15
notes.py
from collections import defaultdict
import csv
csv.field_size_limit(999999999)
def get_csv(filename):
# get data from csv
# don't use built ins, like input, as variable names
with open('filename', 'r') as file_handle:
reader = csv.reader(file_handle, delimiter='|')
@1328
1328 / disco.py
Created May 14, 2018 12:05
Mock up for disco adventure
class Message():
'''mockup for discord message'''
def __init__(self, user, incoming):
self.user = user
self.incoming = incoming
def send_message(self, what):
print('{}: {}'.format(self.user, what))
@1328
1328 / weap.py
Created April 12, 2018 15:02
weapon grabber
import requests
from bs4 import BeautifulSoup
import sqlite3
import sys
import time
GROUPS = {
'Grenade':(52,55),
'Other':(55,56),
@1328
1328 / x.py
Created August 8, 2016 15:23
RSP
from __future__ import print_function
from builtins import input
#!/bin/py
#Python 2.7.6
"""A text-based Python 2.7.6 implementation of the game Rock-Paper-Scissors.
Game play:
* each round, both players select from: rock, paper, or scissors
* rock beats scissors, scissors beats paper, paper beats rock
@1328
1328 / dll.py
Created April 12, 2016 17:18
doublelinkedlist
class Node(object):
"""The class the handles the Node objects"""
def __init__(self, data=None, prev=None, next=None):
self.data = data
self.prev = prev
self.next = next
def __str__(self):
return "Node[Data = %s]" % (self.data,)