Skip to content

Instantly share code, notes, and snippets.

View abunsen's full-sized avatar
🍊
Florida, man!

Auston Bunsen abunsen

🍊
Florida, man!
View GitHub Profile
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win';'i am a {0}er'.format(lol);"
1000000 loops, best of 3: 0.72 usec per loop
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win'; ''.join(['i am a ', lol]);"
1000000 loops, best of 3: 0.58 usec per loop
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win'; 'i am a %ser' % lol;"
1000000 loops, best of 3: 0.39 usec per loop
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win'; 'i am a '+ lol +'er'"
1000000 loops, best of 3: 0.26 usec per loop
import csv
ifile = open('test.csv', "rb")
reader = csv.reader(ifile)
rownum = 0
for row in reader:
print dir(row[rownum])
rownum += 1
{% block top_content %}
<br/>
<div id="order_notification" class="left rg_font">
<div class="title">Here is what your user ordered:</div>
<div class="table_headers">
<div class="header quantity_col">Quantity</div>
<div class="header desc_col">Item Description</div>
<div class="header amount_col">Amount</div>
@abunsen
abunsen / gist:2418721
Created April 19, 2012 05:07 — forked from anonymous/gist:2418719
Step 1 Character Countdown
{% extends "forms/form_base.html" %}
{% block maincontent %}
{% block additional-js %}
{{ block.super }}
<script type="text/javascript" src="{{ MEDIA_URL }}js/step.2.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/bootstrap-limit.js"></script>
{% endblock %}
@abunsen
abunsen / get_aprox.py
Created June 6, 2012 23:02 — forked from igorgue/get_aprox.py
Get aprox number in a list
#!/usr/bin/env python
"""
Create a program that given a requested number gives you
the nearest number in a list.
Considerations:
- The list needs to only contain integers
This example is useful when you have only a certain number of
images sizes available and you have to pick one for your station
#!/usr/bin/env python
"""
Create a program that given a requested number gives you
the nearest number in a list.
Considerations:
- The list needs to only contain integers
This example is useful when you have only a certain number of
images sizes available and you have to pick one for your station
@abunsen
abunsen / min-char-rnn.py
Created May 30, 2016 16:11 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@abunsen
abunsen / craigs_list.rb
Last active March 2, 2017 02:59 — forked from joneslm1/craigs_list.rb
Craiglist Scrubber
require "httparty"
require 'nokogiri'
homepage_url = "https://miami.craigslist.org/"
response1 = HTTParty.get homepage_url
home_page = Nokogiri::HTML(response1.body)
cats = []
url_tag = []
jobs = []