Skip to content

Instantly share code, notes, and snippets.

# Run this at your site root to upgrade EE
# Paths assume your system folder is at site root
# http://expressionengine.com/docs/installation/update.html
#!/bin/bash
# location of the release
RELEASE_PATH="/Users/ryan/Desktop/Incoming/ExpressionEngine1.6.7"
echo "Enter the name of your system folder"
@masugadesign
masugadesign / force or remove www
Created May 13, 2009 00:45
htaccess rules to force or remove www
# Remove the www
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Force the www
# RewriteCond %{HTTP_HOST} !^www\.
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# !/bin/bash
# Set up an new github repository
GITHUB_USERNAME="timkelty"
# from github instructions page after creating a repo
mkdir "$1"
cd "$1"
git init
touch README
@masugadesign
masugadesign / .bash_profile prompt (remote server, Git branch)
Created February 15, 2010 17:49
.bash_profile prompt (remote server, Git branch)
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# non git dir: user@host.server.com:~/var/www: _
# in git dir: user@host.server.com:~/var/www/site.tld (branchname): _
PS1="\[\e[01;31m\]\u@\H:\w\$(parse_git_branch): \[\e[00m\]"
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
{if segment_1 == "search" && segment_2 != ""}
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-000000-1");
pageTracker._initData();
#!/usr/bin/env php
<?php
// This command simply prints out the serialized data in a readable printed array format
// Found on a blog via a google search
// @see http://top-frog.com/2009/08/28/quickly-unserialize-data-in-textmate/
$data = unserialize(file_get_contents('php://stdin'));
print_r($data);
<?php
/*
EE2 hidden configuration variables
Last updated: Jun 20 2010
Obtain this list by putting print_r($this->EE->config->config); on a PHP-enabled template.
See: http://eeinsider.com/tips/view/config-overrides-for-ee-1-and-2/
*/
@masugadesign
masugadesign / quickkill
Created August 25, 2010 18:01
Relaunch Quicksilver if it's non-responsive
#!/bin/sh
killall Quicksilver
open /Applications/Quicksilver.app
@masugadesign
masugadesign / ee1_config.php
Created September 22, 2010 14:14
Sample EE1 config.php file
<?php
if ( ! defined('EXT')){
exit('Invalid file request');
}
$conf['app_version'] = "169";
$conf['license_number'] = "1234-1234-1234-1234";
$conf['debug'] = "1";
$conf['install_lock'] = "1";
@masugadesign
masugadesign / Orders API
Created January 21, 2011 20:29
Developers get purchased item info in JSON format.
<?php
$username = ""; //enter your username here
$password = ""; //enter your password here
$start_dt = "2011-01-01"; start date in YYYY-MM-DD format
$end_dt = "2011-12-31"; end date in YYYY-MM-DD format
// Create the post string
$post_string = "username=".$username."&password=".$password."&start_dt=".$start_dt."&end_dt=".$end_dt;
// Process