Skip to content

Instantly share code, notes, and snippets.

Steve Ross steve-ross

Block or report user

Report or block steve-ross

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
View gist:805982
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="Steven Ross">
<style type="text/css" media="screen">
View gist:1238181
class reader:
def __init__(self):
self.s = str
def main(self, part='body'):
for req in self.requests():
#self.body = {'response': req['body']}
return req[part]
#self.respond(data={"response": req['body']})
View ObjectFactory.cfc
<cfcomponent output="false" hint="Object Factory for Singleton instantiation">
<!--- cleanup cache will only be called on every 500th call to the get function (will rehash the table) --->
<cfset this.currentCacheInterval = 1 />
<cfset this.cacheClearIntervalInMinutes = 180 />
<cffunction name="init">
<cfargument name="isDebug" type="boolean" required="false" hint="pass in true to reload every time" default="false" />
<cfscript>
setCacheTime();
View .bash_profile
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
LIGHT_BLUE="\[\033[1;36m\]"
COLOR_NONE="\[\e[0m\]"
View .git-completion.sh
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@steve-ross
steve-ross / gist:3927019
Created Oct 21, 2012
Upload a file in couchdb with jQuery
View gist:3927019
$('#upload_file').submit(function(e){
e.preventDefault();
var data = {};
$("form :file").each(function() {
data[this.name] = this.value; // file inputs need special handling
});
$(this).ajaxSubmit({
url: database_url + '/' + $('#_id').val() ,
dataType: 'json',
View gist:3927342
if testing:
#drop all the agency db's and new users
print 'dropping all agency databases'
for db in self.server:
if (db.find('agency_') == 0 or db.find('agents') == 0):
del self.server[db]
@steve-ross
steve-ross / gist:5006574
Created Feb 21, 2013
magento select *...
View gist:5006574
$ids = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('entity_id')
->addFieldToFilter('status', array('eq'=>'1'))
->addFieldToFilter('type_id', array('in'=>array('configurable', 'simple')))
->getSelect();
produces:
string 'SELECT `e`.*, `at_status`.`value` AS `status` FROM `catalog_product_entity` AS `e`
View gist:5707907
#STARTS ON OR AROUND LINE 171
DocumentRoot "/Users/sross/Documents/work/projects/www"
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
View gist:5729272
SetEnv MAGE_IS_DEVELOPER_MODE=true
RewriteBase /
############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi
# Action php5-cgi /cgi-bin/php5-cgi
# AddHandler php5-cgi .php
You can’t perform that action at this time.