Skip to content

Instantly share code, notes, and snippets.

View daleathan's full-sized avatar
🏠
Working from home

Dale Athanasias daleathan

🏠
Working from home
View GitHub Profile
@daleathan
daleathan / README.rst
Created February 24, 2014 03:22 — forked from sublee/README.rst

Finger Binary

What's Finger Binary?

Here is a description of `Finger Binary in Wikipedia`_.

Finger binary is a system for counting and displaying binary numbers on the

@title: Learn Tkinter Progressively @author: basicxman @tags: learning progressively tkinter python tutorial

What is Tkinter?

  • A binding for using the Tk graphics framework in Python.
  • A library which has lots of old, large, and verbose documentation
    • Not so helpful to beginners.
from Tkinter import *
root = Tk()
w = Label(root, text="Hello, world!")
root.overrideredirect(True)
root.geometry("{0}x{1}+0+0".format(root.winfo_screenwidth(), root.winfo_screenheight()))
root.focus_set() # <-- move focus to this widget
root.bind("<Escape>", lambda e: e.widget.quit())
w.pack()
@daleathan
daleathan / tree.md
Created March 10, 2014 19:22 — forked from hrldcpr/tree.md

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

I like Learn You a Haskell as a reference and cheat-sheet but I found it a little slow for learning Haskell.

Here's my recommended order for just learning Haskell:

http://www.seas.upenn.edu/~cis194/lectures.html Brent Yorgey's course is the best I've found so far and replaces both Yann Esposito's HF&H and the NICTA course. This course is particularly valuable as it will not only equip you to write Haskell but also help you understand parser combinators.

Real World Haskell is available online. (Thanks bos!)

I recommend RWH as a reference (thick book). The chapters for parsing and monads are great for getting a sense for where monads are useful. Other people have said that they've liked it a lot. Perhaps a good follow-up for practical idioms after you've got the essentials of Haskell down?

#!/usr/bin/env python3
import struct
import re
class Wad(object):
"""Encapsulates the data found inside a WAD file"""
def __init__(self, wadFile):
"""Each WAD files contains definitions for global attributes as well as map level attributes"""
@daleathan
daleathan / wgets.wsf
Created March 25, 2016 04:12 — forked from atifaziz/wgets.wsf
Simple WGET clone in WSH
<job>
<runtime>
<description>A non-interactive web retriever script.
Copyright (c) Atif Aziz. All rights reserved.
Written by Atif Aziz, http://www.raboof.com/
Creative Commons Attribution-ShareAlike 3.0 Unported License.
http://creativecommons.org/licenses/by-sa/3.0/
</description>
@daleathan
daleathan / wclip.py
Created March 27, 2016 20:24 — forked from Asday/wclip.py
from collections import OrderedDict
from ctypes import sizeof
from ctypes.wintypes import (
DWORD,
LONG,
WORD,
)
import pygame
from win32clipboard import (
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
def fuzzy_match_simple(pattern, instring):
"""Return True if each character in pattern is found in order in instring.
:param pattern: the pattern to be matched
:type pattern: ``str``
@daleathan
daleathan / Git push deployment in 7 easy steps.md
Created December 1, 2016 01:58 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook