Skip to content

Instantly share code, notes, and snippets.

View joeyespo's full-sized avatar

Joe Esposito joeyespo

View GitHub Profile
@amacneil
amacneil / json.py
Last active March 18, 2021 03:24
Safely JSON-encode objects in your Django template
from django.core.serializers.json import DjangoJSONEncoder
from django.template import Library
from json import dumps as json_dumps
register = Library()
@register.filter
def json(data):
"""
### Keybase proof
I hereby claim:
* I am joeyespo on github.
* I am joeyespo (https://keybase.io/joeyespo) on keybase.
* I have a public key whose fingerprint is 22EB 13A9 C8CE E5A5 77A7 8AF2 657E 9678 83E5 2DB5
To claim this, I am signing this object:
@forabi
forabi / Webpack 2.0.7-beta vs Rollup
Last active January 28, 2020 08:54
Webpack 2 vs Rollup
❯ rollup --version
rollup version 0.25.3
❯ time rollup -c ./rollup.js
rollup -c ./rollup.js 4.65s user 0.22s system 118% cpu 4.131 total
❯ time webpack
Hash: ebb00bbccd954c114d3c
Version: webpack 2.0.7-beta
Time: 3623ms
@Jarred-Sumner
Jarred-Sumner / comcast.js
Last active September 7, 2022 01:30
Comcast injects this into webpages to show copyright notices
// Comcast Cable Communications, LLC Proprietary. Copyright 2014.
// Intended use is to display browser notifications for critical and time sensitive events.
var _ComcastAlert = (function(){
return {
SYS_URL: '/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do'
, dragObj: {zIndex: 999999}
, browser: null
, comcastCheck: 1
, comcastTimer: null
, xmlhttp: null
@ideasasylum
ideasasylum / translate_amazon.js
Last active July 30, 2020 23:18
Translate Amazon service names into plain English (see https://www.expeditedssl.com/aws-in-plain-english)
// ==UserScript==
// @name Translate Amazon
// @namespace http://your.homepage/
// @version 0.1
// @description Translate the Amazon service names into plain English. See https://www.expeditedssl.com/aws-in-plain-english
// @author @ideasasylum
// @match https://*.console.aws.amazon.com/console/home?*
// @grant none
// ==/UserScript==
@ryancdotorg
ryancdotorg / frag32.py
Created August 20, 2015 16:27
A FAT32 fragmenter, because I am a horrible person.
#!/usr/bin/env python
import random
import struct
import sys
# Most of the Fat32 class was cribbed from https://gist.github.com/jonte/4577833
def ppNum(num):
return "%s (%s)" % (hex(num), num)
@joeyespo
joeyespo / type.css
Created July 17, 2015 15:20
Silkscreen Font
@font-face {
font-family: 'MyWebFont';
src: url('silkscreen_normal_macroman/slkscr-webfont.eot'); /* IE9 Compat Modes */
src: url('silkscreen_normal_macroman/slkscr-webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('silkscreen_normal_macroman/slkscr-webfont.woff') format('woff'), /* Pretty Modern Browsers */
url('silkscreen_normal_macroman/slkscr-webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('silkscreen_normal_macroman/slkscr-webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
import json
from urllib import urlencode
from flask import Flask, request, jsonify
app = Flask(__name__)
app.debug = True
// This function is called immediately. The second function is passed in
// as the factory parameter to this function.
(function (factory) {
// If there is a variable named module and it has an exports property,
// then we're working in a Node-like environment. Use require to load
// the jQuery object that the module system is using and pass it in.
if(typeof module === "object" && typeof module.exports === "object") {
factory(require("jquery"), window, document);
}
// Otherwise, we're working in a browser, so just pass in the global
@danharper
danharper / gulpfile.js
Last active April 11, 2024 08:31
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));