Skip to content

Instantly share code, notes, and snippets.

View mjard's full-sized avatar

Michael Jard mjard

  • Misadventure Games
View GitHub Profile
# pythonic
def map(source, func):
dest = []
for x in source:
dest.append(func(x))
return dest
# list comprehension
def map(source, func):
return [func(x) for x in source]
# kaptin, safe from desg
def map(source, func):
return __builtins__.map(func, source)
# sixthgear
def mop(source, func):
return map(func, source)
# pythonic
def map(source, func):
import requests
import time
def getReddit(subreddit):
request = requests.get("http://reddit.com/r/%s/.json" % subreddit)
return request.json()['data']['children']
seen_ids = set()
while True:
@mjard
mjard / blah.go
Last active December 12, 2015 03:18 — forked from sirpengi/blah.go
package main
func modify (myarr *[]int) ([]int) {
return append(*myarr, 4)
}
func main() {
arr := []int{}
arr = append(arr, 1)
arr = append(arr, 2)