Skip to content

Instantly share code, notes, and snippets.

View elgreg's full-sized avatar
💭
Inside

Greg Lavallee elgreg

💭
Inside
View GitHub Profile
@elgreg
elgreg / keybase.md
Created March 11, 2021 16:13
keybase.md

Keybase proof

I hereby claim:

  • I am elgreg on github.
  • I am elgreg (https://keybase.io/elgreg) on keybase.
  • I have a public key whose fingerprint is 8E84 80F7 57BE ACB6 E352 D0DA 5417 4FB2 9BF0 2CAD

To claim this, I am signing this object:

@elgreg
elgreg / get_all_tweets.sh
Last active April 19, 2019 13:48
Get all the tweets in a thread starting at the end
#!/usr/bin/env bash
START=$1
CURRENT="${START}"
mkdir $START
download_tweet () {
twurl "/1.1/statuses/show/${CURRENT}.json" > "${START}/${1}.json"
}
@elgreg
elgreg / get_all_tweets.sh
Created April 19, 2019 11:13
Get all the tweets in a thread starting at the end
#!/usr/bin/env bash
START=$1
CURRENT="${START}"
mkdir $START
download_tweet () {
twurl "/1.1/statuses/show/${CURRENT}.json" > "${START}/${1}.json"
}
export DOCKER_FOR_MAC_IP=`docker run alpine ping -n -q -c 1 docker.for.mac.localhost | grep -o -E [0-9^/]+\.[0-9^/]+\.[0-9^/]+\.[0-9^/]+ | head -n 1 | xargs echo -n
#! /bin/bash
# Requires imagemagick (brew install imagemagick)
# Usage:
# ./pad_to_3_x_2.sh [image-name]
#
# produces resized-[image-name]
#
# Example:
@elgreg
elgreg / contentscript.js
Created November 8, 2017 18:42
The contenscript behind the 140 extension for Twitter by Slate
'use strict';
$(document).ready(function(){
var styles = '<style> .twttr140RadialRed { color:red !important; stroke:red !important;} </style>';
$('head').append(styles);
var $tweetModal = $('.modal-tweet-form-container .RichEditor-scrollContainer');
var $homeTimeLine = $('#tweet-box-home-timeline');
var tweetMax = 140;

Keybase proof

I hereby claim:

  • I am elgreg on github.
  • I am elgreg (https://keybase.io/elgreg) on keybase.
  • I have a public key whose fingerprint is 3D74 2DDC F068 E1F5 B46D CEFE 9E90 568A 0502 F469

To claim this, I am signing this object:

#!/bin/bash
# Usage - elb_private_ips [name-of-elb]
aws elb describe-instance-health --load-balancer-name $1 | jq '.InstanceStates' | jq '.[] | .InstanceId' | xargs aws ec2 describe-instances --instance-ids | jq .Reservations | jq '.[] | .Instances[0].PrivateDnsName'
@elgreg
elgreg / keybase.md
Created August 15, 2014 03:13
keybase.md verification

Keybase proof

I hereby claim:

  • I am elgreg on github.
  • I am elgreg (https://keybase.io/elgreg) on keybase.
  • I have a public key whose fingerprint is 98B2 1B29 98BD B09D 5C08 6830 4A25 06C0 04DA A642

To claim this, I am signing this object:

@elgreg
elgreg / tweet.jsonp
Created June 1, 2014 17:13
JSONP Tweet
myFunction({
"created_at": "Sun Jun 01 01:40:16 +0000 2014",
"id": 472915502898368512,
"id_str": "472915502898368512",
"text": "Writing Tuesday's class on AJAX and here's a tweet I'll use to show off the Twitter API.",
"source": "<a href=\"https://about.twitter.com/products/tweetdeck\" rel=\"nofollow\">TweetDeck</a>",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,