Skip to content

Instantly share code, notes, and snippets.

@veselosky
veselosky / s3gzip.py
Last active May 8, 2023 21:42
How to store and retrieve gzip-compressed objects in AWS S3
# vim: set fileencoding=utf-8 :
#
# How to store and retrieve gzip-compressed objects in AWS S3
###########################################################################
#
# Copyright 2015 Vince Veselosky and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@veselosky
veselosky / README.md
Last active December 12, 2015 08:49
Toy: Node.js vs. Python

Not sure how I feel about Node.js after this experiment. Trying to wrap my mind around the fact that any function that performs I/O cannot return a value, but must instead take a callback that would operate on that value. Which means that any function that MIGHT one day perform I/O (or call something that does) cannot return a value, but must take a callback instead. In my mind, this makes it unsafe EVER to write a function that merely returns a value, unless what it is doing is pure calculation (in which case you could probably inline it).

This toy script takes a directory as an argument, finds all the files in that directory (without recursing), and prints their contents.

The Python version seems pretty straight-forward to me, easy to read, easy to write.

The Node version was harder to write, but only because of my inexperience I think. However, my first try had a subtle bug that caused it to produce the wrong output (commented).

What kills me is how path.exists() must take a callback, because it has

@veselosky
veselosky / gitconfig
Created March 22, 2012 20:26
If you use rebase in your workflow, put this in your gitconfig
[branch]
autosetupmerge = true
autosetuprebase = remote
@veselosky
veselosky / .gitignore
Created September 6, 2011 22:29 — forked from pcardune/.gitignore
Facebook command-line client helper
.fb_access_token
.fbconsole.py