Skip to content

Instantly share code, notes, and snippets.

View elgreg's full-sized avatar
💭
Inside

Greg Lavallee elgreg

💭
Inside
View GitHub Profile
$ git branch -r --merged origin/master |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
@elgreg
elgreg / getScrollTop.coffee
Created April 3, 2014 21:56
the scrollTop function from mobile boilerplate in coffeescript just in case I need it
# thx. HTML5 Mobile Boilerplate
# https://github.com/h5bp/mobile-boilerplate/blob/v4.1.0/js/helper.js#L43
getScrollTop = ->
return win.pageYOffset or
doc.compatMode is 'CSS1Compat' and doc.documentElement.scrollTop or
doc.body.scrollTop or
0
@elgreg
elgreg / tweet_reply.json
Created June 1, 2014 01:47
A reply to my tweet. Thanks, Josh!
{
"created_at": "Sun Jun 01 01:46:30 +0000 2014",
"id": 472917071706087425,
"id_str": "472917071706087425",
"text": "@elgreg Here's a reply if you need one. And a #hashtag. Tweeple devs looooove #hashtags.",
"source": "<a href=\"https://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android Tablets</a>",
"truncated": false,
"in_reply_to_status_id": 472915502898368512,
"in_reply_to_status_id_str": "472915502898368512",
"in_reply_to_user_id": 1068061,
@elgreg
elgreg / tweet.json
Created June 1, 2014 01:49
Tweet sample
{
"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,
@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,
@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:

#!/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'
Index: S3/CloudFront.py
===================================================================
--- S3/CloudFront.py (revision 392)
+++ S3/CloudFront.py (working copy)
@@ -155,6 +155,104 @@
return ET.tostring(tree)
+class InvalidationList(object):
+ ## <InvalidationList>
@elgreg
elgreg / regions.css
Created January 6, 2012 12:22
CSS Regions - part 1
#test {
background-color: #fff;
}
@elgreg
elgreg / addEventListener-polyfill.js
Created June 4, 2012 16:45 — forked from eirikbacker/addEventListener-polyfill.js
addEventListener polyfill for IE6+
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}