Skip to content

Instantly share code, notes, and snippets.

View apg's full-sized avatar
🐢
Turtle

Andrew Gwozdziewycz apg

🐢
Turtle
View GitHub Profile
@apg
apg / stats.el
Created July 10, 2014 15:59
stats
(let* ((values '(11152 6423 8383 7466 6759 7249 6951 8793 7949 6840 7209 8022 11493 11331 6787 5616 9175 9528 7883 7210 10142))
(sum (reduce '+ values))
(avg (/ sum (length values)))
(mini (apply 'min values))
(maxi (apply 'max values))
(dev (reduce '+ (mapcar '(lambda (x) (* (- x avg) (- x avg))) values)))
(std (sqrt (/ dev (length values)))))
(list sum avg mini maxi dev std))
@apg
apg / gist:bf6c46d1604ca2f535ab
Created July 7, 2014 23:52
Epigrams in Programming - Perilsisms
EPIGRAMS IN PROGRAMMING
1. One man's constant is another man's variable.
2. Functions delay binding; data structures induce binding. Moral: Structure data late in the programming process.
3. Syntactic sugar causes cancer of the semicolon.
@apg
apg / round-31.md
Last active August 29, 2015 14:02
Round 31

Round 31: Free. Functional and Secure...

Hello hackers,

Thanks to eBay for hosting us again! eBay always provides a great atmosphere and enough pizza and beer to satisfy everyone. As is standard affair in NYC, they're likely hiring!

Projects Presented (in pseudo-random order)

Nick Kersting

@apg
apg / match.py.md
Created May 22, 2014 02:43
match thing

Many years ago, Marius Eriksen wrote asome code to do pattern matching in Python. I quickly forked the code and had envisioned expanding upon it by "fixing" the interface, and making it possible to dispatch functions with it like the Erlang example he provided.

Like most of my ambitions of this type, it never happened, and despite the fact that I had forked the repo it went completely untouched. In the mean time, though, I had played with with, on numerous occassions, experiments that were fueled by my inability to properly extend the language without diving into it's internals.

But, recently, I had a little bit of time to spare while waiting for a meeting, and so, I made an attempt at providing pattern matched function dispatch to Python.

With it, Marius's example looks

Alicebot, Alicebot, does whatever an Alicebot does.
Likes to stand,
Loves to crawl,
Likes to eat, whatever she can.
Look out! Here comes Alicebot!

Round 30: Things We Say

Hello Hackers.

Thank you to The Ladders for hosting Round 30, and providing pizza and alcohol. Not unlike any other company in NYC, they're hiring, and because they were so nice to us, we repeat that here. They've hired a few Hacker Schoolers, none of which run away, which says something good about their culture. Reach out to John Connolly if you're interested: [email protected]

Projects

Aditya Mukerjee

@apg
apg / animate.sh
Last active August 29, 2015 14:00
for n in {10..85}; do
./pixmaker -s $n -src ~/heartbleed.png ~/frame$n.png
done
gifme --reverse ~/Desktop/frame*.png
### Keybase proof
I hereby claim:
* I am apg on github.
* I am apg (https://keybase.io/apg) on keybase.
* I have a public key whose fingerprint is B658 B173 C61E A483 C0D0 1E9D 288E DB47 3361 6035
To claim this, I am signing this object:
@apg
apg / README
Created February 13, 2014 07:18
ride the wave file, man.
Compile:
$ LDFLAGS="-lm" make wavrider
Run:
$ ./wavrider < wavrider.c
$ mplayer output.wav
Wavrider will turn 40 characters into solid gold waves.
@apg
apg / round-28.md
Last active August 29, 2015 13:56
Hack and Tell - Round 28

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Hate markdown? See this in all its rendered glory.

Round 28: Jeepy Gee

Hello Hackers-

Thanks to Meetup for hosting us! As always