This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Project Euler Problem 1 | |
; | |
; If we list all the natural numbers below 10 that are multiples of 3 or 5 | |
; we get 3, 5, 6 and 9. The sum of these multiples is 23. | |
; | |
; Find the sum of all the multiples of 3 or 5 below 1000. | |
; | |
; solution by nathan dotz | |
; nathan (period) dotz (at sign) gmail (period) com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Project Euler Problem 1 | |
; | |
; If we list all the natural numbers below 10 that are multiples of 3 or 5 | |
; we get 3, 5, 6 and 9. The sum of these multiples is 23. | |
; | |
; Find the sum of all the multiples of 3 or 5 below 1000. | |
; | |
; solution by nathan dotz | |
; nathan (period) dotz (at sign) gmail (period) com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Project Euler Problem 2 | |
; Solution by nathan dotz - nathan (period) dotz (at sign) gmail (period) com | |
; | |
; Each new term in the Fibonacci sequence is generated by adding | |
; the previous two terms. By starting with 1 and 2, the first | |
; 10 terms will be: | |
; 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... | |
; | |
; Find the sum of all the even-valued terms in the sequence | |
; which do not exceed four million. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# | |
# Set cpu scaling policy the convenient way. | |
# | |
# nathan (period) dotz (at) gmail (period) com | |
# | |
max_cpu() { | |
echo performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor | |
echo performance | sudo tee /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-- | |
- Save this file as Main.hs and run with % runghc Main.hs | |
-} | |
module Main where | |
import Test.HUnit | |
derp = test [ "a silly test" ~: 'a' ~=? 'a' ] | |
tests = TestList [ derp ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ---------------------------------------------------------------------------- | |
# "THE BEER-WARE LICENSE" (Revision 42): | |
# <[email protected]> wrote this file. As long as you retain this notice you | |
# can do whatever you want with this stuff. If we meet some day, and you think | |
# this stuff is worth it, you can buy me a beer in return - Nathan Dotz | |
# ---------------------------------------------------------------------------- | |
# | |
# This script will use pygame to turn a rockband drum kit plugged in your USB | |
# port into a sampler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Parses the U.S. Securities and Exchance Commision website for info on | |
# Form 4/A filings. | |
from urllib import urlopen | |
import re | |
class SECParser: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns tootr.core | |
(:use | |
[compojure.core :only (defroutes GET POST)] | |
[hiccup.page-helpers :only (html5)] | |
[hiccup.form-helpers :only (form-to label text-area submit-button)] | |
) | |
(:require [ring.adapter.jetty :as ring] | |
[compojure.handler :as handler] | |
[clojure.contrib.sql :as sql] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("derps when using a space in an event name", function() { | |
var callback = jasmine.createSpy('-Custom Event Callback-'); | |
obj.bind('all', callback); | |
obj.trigger("foo bar"); | |
expect(callback.callCount).toBe(1); | |
expect(callback.mostRecentCall.args[0]).toBe('foo bar'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time, random | |
from multiprocessing import Process, Pipe, current_process | |
from multiprocessing.connection import wait | |
def foo(w): | |
for i in range(10): | |
w.send((i, current_process().name)) | |
w.close() | |
if __name__ == '__main__': |