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 base64 | |
from django.utils import simplejson | |
import urllib | |
from google.appengine.api import urlfetch | |
def track(event, properties=None): | |
""" | |
A simple function for asynchronously logging to the mixpanel.com API on App Engine | |
(Python) using RPC URL Fetch object. | |
@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
NUMBER_OF_CPU_CORES=2 | |
BASHRC=~/.bashrc # use .bash_profile on OS X | |
# Remove old Node.JS installation | |
rm ~/local/*/node* -rf | |
rm ~/.node_libraries -rf | |
sudo rm /usr/local/*/node* -rf | |
sudo rm /usr/*/node* -rf | |
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
<?php | |
/** | |
* Utility for catching PHP errors and converting them to an exception | |
* that can be caught at runtime | |
* @author Jason Hinkle | |
* @copyright 1997-2011 VerySimple, Inc. | |
* @license http://www.gnu.org/licenses/lgpl.html LGPL | |
* @version 1.0 | |
*/ | |
class ExceptionThrower |
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
<b:if cond='data:blog.url == data:blog.homepageUrl'> | |
<title><data:blog.title/> - blog description </title> | |
<b:else/> | |
<b:if cond='data:blog.pageType == "index"'> | |
<title><data:blog.pageName/> - <data:blog.title/> - blog description </title> | |
<b:else/> | |
<b:if cond='data:blog.pageType == "static_page"'> | |
<title><data:blog.pageName/> - <data:blog.title/></title> | |
<b:else/> | |
<b:if cond='data:blog.pageType == "item"'> |
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
<?php | |
/** | |
* Zend Framework Controller Plugin to allow post output processing | |
* | |
* @version 1 | |
* @author Ashley White, http://www.needathinkle.com/ | |
* @license http://creativecommons.org/licenses/by-sa/3.0/ | |
*/ | |
final class Thinkle_Controller_Plugin_PostProcess extends Zend_Controller_Plugin_Abstract { | |
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
<?php | |
/** | |
* Copyright (c) 2007, Roger Veciana | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* Redistributions of source code must retain the above copyright notice, this |
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
Devise.friendly_token |
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 | |
# | |
# Enable TRIM support for 3rd Party SSDs. Works for Mountain Lion | |
# | |
# Source: http://digitaldj.net/2011/07/21/trim-enabler-for-lion/ | |
set -e | |
set -x | |
# Back up the file we're patching |
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
require "pathname" | |
namespace :deploy do | |
task :create_symlink, :except => { :no_release => true } do | |
deploy_to_pathname = Pathname.new(deploy_to) | |
on_rollback do | |
if previous_release | |
previous_release_pathname = Pathname.new(previous_release) | |
relative_previous_release = previous_release_pathname.relative_path_from(deploy_to_pathname) |
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
# Add this to your application.rb | |
config.middleware.use Rack::Cors do | |
allow do | |
origins '*' | |
# location of your API | |
resource '/api/*', :headers => :any, :methods => [:get, :post, :options, :put] | |
end | |
end |
OlderNewer