Skip to content

Instantly share code, notes, and snippets.

// If foo is true, then we do all this stuff
if (foo) {
// Do foo stuff
}
// This is the stuff that happens in the else case
// but now I'm going to keep writing
// and eventually this else will move further
// and further down the page
// and at somepoint, it wont seem logically connected
// to the if at all.
@aconbere
aconbere / rotate.py
Created January 15, 2010 21:28 — forked from zane/rotate.py
removing temp variable
import math
def rotate(array, steps):
steps = steps % len(array)
reverse(array, 0, len(array) - 1)
reverse(array, 0, steps - 1)
reverse(array, steps, len(array) - 1)
return array
def reverse(array, start=0, end=None):
module Main where
import Network.HTTP
import Text.JSON
import System.Environment
get :: String -> IO String
get url = do simpleHTTP (getRequest url) >>= getResponseBody
main :: IO ()