Skip to content

Instantly share code, notes, and snippets.

View hallfox's full-sized avatar

Taylor Foxhall hallfox

  • Bloomberg LP
View GitHub Profile
from kivy.app import App
from kivy.uix.scatter import Scatter
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout
class TestApp(App):
def build(self):
f = FloatLayout()
s = Scatter()
@hallfox
hallfox / ex18.py
Last active August 29, 2015 14:03
My style applied to Ex17 of LPTHW.
from sys import argv
from os.path import exists
script, from_file, to_file = argv
#so much of this printing is incredibly uneccessary
with open(from_file) as src:
with open(to_file, 'w') as dest:
print("Copying from {} to {}".format(from_file, to_file)
data = src.read();
#include <iostream>
using namespace std;
int main()
{
cout << "hello, world";
return 0;
}
@hallfox
hallfox / ex33_hack.py
Last active August 29, 2015 14:04
Practice with breaking code.
#the function from the exercise, modified
def loop_list(n, inc=1):
numbers = []
for i in range(0, n, inc):
print("At the top i is %d" % i)
numbers.append(i)
print("Numbers now:", numbers)
print("At the bottom i is %d" % i)
@hallfox
hallfox / index.html
Last active August 29, 2015 14:04
Something like this...
<!--The rest of your page -->
<div id="banner-wrap">
<a href="path/to/java/page"><img src="path/to/java/img" /></a>
<a href="path/to/python/page"><img src="path/to/python/img" /></a>
<a href="path/to/html/page"><img src="path/to/html/img" /></a>
</div>
<!--Other part of your page -->
@hallfox
hallfox / hack5.c
Created July 31, 2014 02:30
It's easier to do in C.
#include <stdio.h>
int main()
{
int x;
printf("Enter a number: ");
scanf("%d", &x);
printf("You input: %d", x);
CC=#complier
CFLAGS=-c -Wall -g
LDFLAGS=
SOURCES=#source files
OBJECTS=$(SOURCES:.cpp=.o)
TARGET=#build target
all: $(SOURCES) $(TARGET)
$(TARGET): $(OBJECTS)
set nocompatible " Relinquish vi support
filetype off
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#rc()
" Plugin 'githubUsername/repoName'
" Let vundle manage itself:
Plugin 'gmarik/vundle'
backports.ssl-match-hostname==3.4.0.2
certifi==14.5.14
ipython==3.1.0
Jinja2==2.7.3
jsonschema==2.4.0
MarkupSafe==0.23
matplotlib==1.4.3
mock==1.0.1
nose==1.3.6
numpy==1.9.2
set nocompatible " Relinquish vi support
filetype off
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#rc()
" Plugin 'githubUsername/repoName'
" Let vundle manage itself:
Plugin 'gmarik/vundle'