Skip to content

Instantly share code, notes, and snippets.

@steve-ross
steve-ross / .bash_profile
Created June 28, 2012 22:16
bash completions
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\]"
#!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 October 21, 2012 13:46
Upload a file in couchdb with jQuery
$('#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',
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 / select.js
Created November 25, 2015 17:05
autorun
Template.afSelect_semanticUI.onRendered(function() {
let node = this.$(this.firstNode);
node.dropdown(_.extend({
fullTextSearch : this.data.atts.fullTextSearch || false,
allowAdditions : this.data.atts.allowAdditions || false,
maxSelections : this.data.atts.maxSelections || false,
allowCategorySelection: this.data.atts.allowCategorySelection || false,
useLabels : this.data.atts.useLabels === false ? false : true
}, this.data.atts.settings));
@steve-ross
steve-ross / gist:5006574
Created February 21, 2013 17:37
magento select *...
$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`
#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
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
<IfModule php5_module>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
<IfModule dir_module>
DirectoryIndex x index.html index.php index.cfm
</IfModule>
</IfModule>
[alias]
co = checkout
st = status
ci = commit
br = branch
df = diff
lg = log -p
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ls = ls-files