Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Brandon Satrom bsatrom

🏠
Working from home
View GitHub Profile
View edgetpu-with-keras.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theworkflow
theworkflow / s3_access.json
Created Feb 23, 2016
S3 Mongo Access Policy
View s3_access.json
{
"Version":"2012-10-17",
"Statement": [
{
"Sid": "AllowUserToSeeBucketListInTheConsole",
"Action": ["s3:ListAllMyBuckets", "s3:GetBucketLocation"],
"Effect": "Allow",
"Resource": ["arn:aws:s3:::*"]
},
{
@eirikbacker
eirikbacker / addEventListener-polyfill.js
Created Jun 3, 2012
addEventListener polyfill for IE6+
View addEventListener-polyfill.js
//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}
@jlong
jlong / uri.js
Created Apr 20, 2012
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@paulirish
paulirish / data-markdown.user.js
Last active Jul 2, 2022
*[data-markdown] - use markdown, sometimes, in your HTML
View data-markdown.user.js
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
View chat.html
<!DOCTYPE html>
<html>
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script>
<script>
$(document).ready(function(){
function debug(str){ $("#debug").append("<p>"+str+"</p>"); };
if(typeof WebSocket === 'undefined') {
alert("Your browser does not support websockets.")
}
@tbeseda
tbeseda / gist:1096141
Created Jul 20, 2011
Cakefile to watch and recursively concat and compile CoffeeScript automatically.
View gist:1096141
fs = require 'fs'
{exec} = require 'child_process'
util = require 'util'
growl = require 'growl'
appFiles = [
'src/hasToGoFirst.coffee' # put your files that must be loaded in first into the array
'src/notAsImportantButNeedsToGoBeforeTheRest.coffee'
]
@bsatrom
bsatrom / usage.js
Created Jun 2, 2011
Starting point for mocking window.external methods for Pinned Site functionality
View usage.js
//sample usage, with qUnit and pinify
//<script src="js/jquery-1.6.min.js"></script>
//<script src="js/jquery.pinify.js"></script>
//<script src="js/qunit.js"></script>
module('', {
teardown: function() {
windowMocks.resetWindow();
}
});
@pguillory
pguillory / gist:729616
Created Dec 5, 2010
Hooking into Node.js stdout
View gist:729616
var util = require('util')
function hook_stdout(callback) {
var old_write = process.stdout.write
process.stdout.write = (function(write) {
return function(string, encoding, fd) {
write.apply(process.stdout, arguments)
callback(string, encoding, fd)
}