Skip to content

Instantly share code, notes, and snippets.

Jessie Wincek jbwincek

Block or report user

Report or block jbwincek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jbwincek
jbwincek / cellspace.py
Last active Aug 1, 2016
CellSpace is a thin wrapper around dictionaries that adds 2D slicing and bounds information to dicts of (x,y) coordinate pairs.
View cellspace.py
from collections import UserDict
from numbers import Integral
class CellSpace(UserDict):
""" CellSpace adds 2D slicing and bounds information to dicts of (x,y) coordinate pairs.
Notes: CellSpace does not support assigning by slice at this point.
Height and width are not absolute measures of how many cells CellSpace contains in
either direction. Instead they show the max labeled cell, this can be considered
View string_concat_times_experiment.py
""" Test the speed of various string concatenation methods """
import timeit
def not_join(size = (40,40)):
blank_dict = {}
output = ''
for y in range(size[1]):
if y>0:
output += '\n'
for x in range(size[0]):
@jbwincek
jbwincek / coroutine_box_handler.py
Last active Feb 24, 2016
using a coroutine to save state for repeated box rendering
View coroutine_box_handler.py
""" notes coroutine box handler: using a coroutine to save state for repeated box rendering
* Box renders input, rolls over to new lines when it hits the end.
* Box uses arrow keys to update size
* the box_updated flag exists so that when in the loop, the box only gets redrawn
when the size changes
* text flow inside the box updates after a new character is hit
* ``with curtsies.Input() as input:`` makes input be a generator, perhaps further
optimization could be done with calling next on it, instead of using it in a for loop
* the double break is to get out of the for loop, and then the ``while True:`` loop
* exceptions propagate out from the generator, hence the raise stop iteration error
@jbwincek
jbwincek / bggl_board_generator.py
Last active Nov 24, 2015
A simple script that generates valid Boggle™ dice configurations.
View bggl_board_generator.py
import random
import textwrap
# Actual Boggle dice
dice = ['aspffk',
'tesois',
'ehgewn',
'atwtoo',
'uensie',
'itmuoc',
View nonsense_word_getter.py
from bs4 import BeautifulSoup
import requests
def main():
r = requests.get('http://www.soybomb.com/tricks/words/')
soup = BeautifulSoup(r.text, 'html.parser')
tags_with_words = soup.find_all('td')
for tag in tags_with_words:
if tag.string:
print(tag.string)
View deviantart_gallery_downloader.py
@jbwincek
jbwincek / befunge.tmLanguage
Created Sep 15, 2015
Sublime 3 Syntax highlighting for Befunge source code
View befunge.tmLanguage
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>bf</string>
</array>
<key>name</key>
<string>Befunge</string>
You can’t perform that action at this time.