Skip to content

Instantly share code, notes, and snippets.

View elgreg's full-sized avatar
💭
Inside

Greg Lavallee elgreg

💭
Inside
View GitHub Profile
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}
@elgreg
elgreg / Spoiler
Last active December 14, 2015 14:58
The answers to google's io game - Spoiler alert!
Go to https://developers.google.com/events/io/
In the console find the app.min.js, then find anything inside of the anonymous function that has this.patternMatcher.
Set a breakpoint.
Refresh.
var p = this.patternMatcher_.matchers_;
for(var _p in p){ if(p[_p].isPartial === false){ console.log(p[_p]); }};
<div class="flag">
<div class="stars">
<div class="star star-first">
<div class="star-arrow star-arrow-one"></div>
<div class="star-arrow star-arrow-two"></div>
<div class="star-arrow star-arrow-three"></div>
</div>
<div class="star">
<div class="star-arrow star-arrow-one"></div>
<div class="star-arrow star-arrow-two"></div>
while true; do wget "https://public.dmv.washingtondc.gov/waitwatch/95m2/video.jpg"; sleep 35; kill -0 "$$" || exit; done 2>/dev/null &
$ 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,