Skip to content

Instantly share code, notes, and snippets.

View sleibrock's full-sized avatar
🗿
Chronomaly Moai

Steven sleibrock

🗿
Chronomaly Moai
View GitHub Profile
@sleibrock
sleibrock / smallest-types-in-python.py
Created October 10, 2016 17:48
Size of Types in Python
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
Goal: To examine which type is the smallest in Python
Types used: int, float, str, list, tuple, dict, set, frozenset
None, Ellipsis, object, lambda, function, Exception
"""
def f(): return
@sleibrock
sleibrock / linux-starters.md
Last active October 11, 2016 21:49
Linux Starters Guide

GNU/Linux Command Reference

Terms and Basics

UNIX = system designed at Bell Labs, created by Dennis Ritchie

Linux = derivative of UNIX, created by Linus Torvalds

Dennis Ritchie = creator of UNIX, C programming language, hero to us all

@sleibrock
sleibrock / colors.py
Created August 9, 2016 21:09
Prints all ANSI colors in your terminal
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
Basic colors script
prints all ANSI colors from 0 to 256
to show you your term's color mapping
"""
from sys import argv
@sleibrock
sleibrock / hn-whos-hiring.py
Created August 2, 2016 20:00
Search "Who's Hiring" HackerNews threads
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
Scraping "Who's Hiring" Posts on Hackernews
Requires: BeautifulSoup4, Requests, Python 3
"""
from sys import argv
@sleibrock
sleibrock / FizzBuzz.hs
Created July 28, 2016 22:03
FizzBuzz with Haskell
-- Fizzbuzzing
fizzBuzz True False _ = "Fizz"
fizzBuzz False True _ = "Buzz"
fizzBuzz True True _ = "FizzBuzz"
fizzBuzz _ _ x = show x
main = do
mapM_ putStrLn [fizzBuzz (three x) (five x) x | x <- [1..100]]
where
three n = n `mod` 3 == 0