This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's how to copy & restore Focus preferences | |
1) (On old computer) Copy preferences file to desktop. This BradJasper.Focus.plist file saves all of your settings. You can back this up in Dropbox if you want. | |
cp ~/Library/Preferences/BradJasper.Focus.plist ~/Desktop/ | |
2) (On new computer) Kill focus & preferences monitor | |
killall Focus; killall cfprefsd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ACTIVE_NETWORK=$(echo "open|||get Setup:/Network/Service/$(echo "open|||get State:/Network/Global/IPv4|||d.show" | tr '|||' '\n' | scutil | grep "PrimaryService" | awk '{print $3}') |||d.show" | tr '|||' '\n' | scutil | grep "UserDefinedName" | awk -F': ' '{print $2}') | |
FOCUS_BLACKHOLE_PID=$(ps aux | grep FocusBlackholeProxy | grep -v grep | awk '{print $2}') | |
PROXY_URL_OUTPUT=$(networksetup -getautoproxyurl "$ACTIVE_NETWORK") | |
if [[ $PROXY_URL_OUTPUT == *"focus"* ]] | |
then | |
echo "Focus is active!" | |
else | |
echo "Focus is not active" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ACTIVE_NETWORK=$(echo "open|||get Setup:/Network/Service/$(echo "open|||get State:/Network/Global/IPv4|||d.show" | tr '|||' '\n' | scutil | grep "PrimaryService" | awk '{print $3}') |||d.show" | tr '|||' '\n' | scutil | grep "UserDefinedName" | awk -F': ' '{print $2}') | |
echo "Active network is '$ACTIVE_NETWORK'" | |
echo "Turning off active network PAC" | |
sudo networksetup -setautoproxystate "$ACTIVE_NETWORK" off | |
echo "Removing NSUserDefaults" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copyright (c) 2013 Jamz Tang <jamz@jamztang.com> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is furnished | |
to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# encoding: utf-8 | |
# | |
# Grab iTunes Icon - Brett Terpstra 2014 <http://brettterpstra.com> | |
# | |
# Retrieve an iOS app icon at the highest available resolution | |
# All arguments are combined to create an iTunes search | |
# The icon for the first result, if found, is written to a filename based on search terms | |
# | |
# example: |
NewerOlder