Skip to content

Instantly share code, notes, and snippets.

View rchowe's full-sized avatar

RC Howe rchowe

View GitHub Profile
for i in $(seq 2 1000); do
./check_prime.py $i &
done | sort
for i in $(seq 2 1000); do
./check_prime.py $i
done
@rchowe
rchowe / check_prime.py
Last active August 29, 2015 14:15
Check primes
#!/usr/bin/env python
#
# check_prime.py
# Check if a number (given by the first argument) is prime.
#
import sys
import math
# Die if there is no first argument.
$('body').bind 'paste', (event) ->
console.log 'paste!'
items = (event.clipboardData or event.originalEvent.clipboardData).items
for i in [0..items.length-1]
continue unless items[i].kind == 'file'
# Process File Objects
dropZone.addEventListener 'dragover', ->
event.stopPropagation()
event.preventDefault()
event.dataTransfer.dropEffect = 'copy'
$('#drag-coverall').show()
$('#song-upload').css('opacity', '0')
$('#song-upload').parent().prepend('<a id = "upload-button" class = "btn btn-default" href = "#">Upload from Computer</a>')
$('#upload-button').click (e) ->
e.preventDefault()
$('#song-upload').trigger('click')
<form method = 'post' action = '/songs' enc = 'multipart/form-data'>
<input type = 'file', name = 'upload_songs' />
</form>
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
import time
def clear():
print(chr(27) + "[2J")
#!/usr/bin/env python
#
# markov.py
# Generates a Markov chain from a body of text.
#
from __future__ import print_function
import sys
import random
import bot
@bot.reply(r'alot')
def alot(message):
message.reply("I'll allot you a lot of alots.")
if __name__ == '__main__':
bot.setup(host='irc.foonetic.net', user='DasBot', channel='#bloopy')