Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# who are the contributor to this repo?
#
# Check if the repository path is provided
if [ -z "$1" ]; then
echo "Usage: $0 /path/to/repo [start_date] [end_date]"
exit 1

I think a lot about building social experiences. Building social and communities sites were hugely formative in my life, and the time in which I grew up. I also believe that social and communitiy experieces are a critical force in makign the world better, and as a technologist I think a lot about in what ways technology can play a positive role in their formation. But there is a problem that haunts me, so I'm writing this out as a way to start addressing it.

It used to be relatively cheap and easy to build a social network. This was great because there are lots of social experiments that can be a positive force in the world, but don't achieve the kind of scales that make them commercially viable in our modern advertising ecosystem. The internet (including the pre-web) internet flourished with dedicated small community discussion sites, and early 2000s web saw a similar flourish of purpose built social experiments around interests (think last.fm, or allconsuming, or mirror project, or dozens and dozens of ot

const fs = require('fs');
const es = require('event-stream');
const stripBom = require('strip-bom');
let filepath = './short.tsv';
let reader = fs.createReadStream(filepath);
let keys;
reader.pipe(es.split())
git filter-branch --index-filter 'git rm --cached --ignore-unmatch bad-file-to-remove.py'
#! /bin/bash
python -m unittest $@
@kellan
kellan / square_thumb.py
Created July 26, 2016 15:17
square thumbnails with Python PIL (Pillow), make sure to rotate correctly
from __future__ import print_function
from PIL import Image, ExifTags
def square_thumb(img, thumb_size):
THUMB_SIZE = (thumb_size,thumb_size)
exif=dict((ExifTags.TAGS[k], v) for k, v in img._getexif().items() if k in ExifTags.TAGS)
if exif['Orientation'] == 3 :
img=img.rotate(180, expand=True)
@kellan
kellan / ec2-ssh.sh
Created July 5, 2016 17:51
ec2 ssh by instance id
function ec2-ssh () {
FOO=$(aws ec2 describe-instances --filter Name=instance-id,Values=$1 | jq '.Reservations[0].Instances[0].PublicIpAddress,.Reservations[0].Instances[0].\
KeyName' | tr -d '"')
IPADDR=$(echo $FOO | cut -d" " -f1)
KEYNAME=$(echo $FOO | cut -d" " -f2)
ssh -i ~/.ssh/$KEYNAME.pem ec2-user@$IPADDR
}
update_expression, update_expression_names, update_values = generate_update(item)
resp = table.update_item(
Key=key,
UpdateExpression=update_expression,
ExpressionAttributeNames=update_expression_names,
ExpressionAttributeValues=update_values)
print(resp)
Cheshire Cat: If I were looking for a white rabbit, I'd ask the Mad Hatter.
Alice: The Mad Hatter? Oh, no no no...
Cheshire Cat: Or, there's the March Hare, in that direction.
Alice: Oh, thank you. I think i shall visit him...
Cheshire Cat: Of course, he's mad, too.
Alice: But I don't want to go among mad people!
Cheshire Cat: Oh, you can't help that. Most everyone's mad here.

Keybase proof

I hereby claim:

  • I am kellan on github.
  • I am kellan (https://keybase.io/kellan) on keybase.
  • I have a public key whose fingerprint is 8CB7 E4FB 7173 4981 2448 20C0 886E 691B 1563 5181

To claim this, I am signing this object: