Skip to content

Instantly share code, notes, and snippets.

💭
🚀 Building Focus, RemoteHabits and something new

Brad Jasper bradjasper

💭
🚀 Building Focus, RemoteHabits and something new
Block or report user

Report or block bradjasper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bradjasper
bradjasper / gist:7344832
Created Nov 6, 2013
This tests aborting font files from TypeKit web fonts. This doesn't work as expected.
View gist:7344832
var page = require('webpage').create();
// Block fonts
var abort_content_types = [
"application/x-font-woff",
"font/woff",
"font/opentype",
];
// Default user agent won't work with TypeKit
@bradjasper
bradjasper / Test Google Fonts
Created Nov 6, 2013
This tests aborting font files from Google web fonts. This works as expected.
View Test Google Fonts
var page = require('webpage').create();
// Block fonts
var abort_content_types = [
"application/x-font-woff",
"font/woff",
"font/opentype",
];
// Default user agent won't work with TypeKit
View gist:4221963
SubtlePatterns Bookmarklet is a quick and easy way to see patterns from http://subtlepatterns.com on your site.
Drag this link <a href="javascript:(function()%7Bvar%20newscript%3Ddocument.createElement(%27script%27)%3Bnewscript.type%3D%27text/javascript%27%3Bnewscript.async%3Dtrue%3Bnewscript.src%3D%27https://raw.github.com/bradjasper/subtle-patterns-bookmarklet/master/bookmarklet.js%3Fcb%3D%27%20%2B%20Math.random()%3B(document.getElementsByTagName(%27head%27)%5B0%5D%7C%7Cdocument.getElementsByTagName(%27body%27)%5B0%5D).appendChild(newscript)%3B%7D)()%3B">Subtle Patterns Bookmarklet</a> to your bookmarks bar, and click it to activate on any site you want to change backgrounds on.
Press left and right to move between patterns. The current pattern is displayed in the lower left corner of the browser.
Similar projects:
http://raphaeleidus.com/2011/06/29/background-patterns-bookmarklet
View gist:1162718
if __name__ == "__main__":
doIt();
View show
# Usage: show <local-port> <subdomain>
function show() {
DOMAIN=".tekacs.com"
REMOTE="$2$DOMAIN"
ssh -tR 1080:127.0.0.1:$1 vps "sudo ssh -Nl \$USER -L $REMOTE:80:127.0.0.1:1080 localhost"
}
View mixpanel.py
# Example of adapting Mixpanel task to work with Celery
import base64
import simplejson
import urllib2
def track(event, properties=None):
"""
A simple function for asynchronously logging to the mixpanel.com API.
@param event: The overall event/category you would like to log this data under
View mixpanel.py
# This isn't perfect for high traffic sites, if you need something more production ready
# please tell us or stay tuned as we will open it up shortly.
import subprocess
import base64
import simplejson
def track(event, properties=None):
"""
A simple function for asynchronously logging to the mixpanel.com API.
View gist:302283
@import blueprint/reset.sass
@import partials/base.sass
@import blueprint
@import blueprint/modules/scaffolding.sass
@import compass/utilities.sass
+blueprint-typography("body.bp")
+blueprint-scaffolding("body.bp")
@bradjasper
bradjasper / demo.py
Created Oct 30, 2009
Dead simple event tracking with celery and git
View demo.py
from mixpanel.tasks import TrackEvent
# Inside a view
def my_view(request):
TrackEvent.delay("search_view", {
"ip": request.META['REMOTE_ADDR'],
"distinct_id": session_id,
"time": time.time()})
You can’t perform that action at this time.