Skip to content

Instantly share code, notes, and snippets.

@diago
diago / xdebug.ini
Last active December 19, 2015 01:39
zend_extension=/usr/lib/php/modules/xdebug.so
; General settings
xdebug.cli_color=1
xdebug.var_display_max_depth=10
; xdebug.show_exception_trace=1
xdebug.show_mem_delta=1
; xdebug.show_local_vars=1
; xdebug.collect_params=1
; xdebug.coverage_enable=1
upstream portal {
server 127.0.0.1:3000;
server 127.0.0.1:3001;
}
server {
listen 80 default_server;
server_name _;
root /opt/portal/public;
upstream portal {
server 127.0.0.1:3000;
server 127.0.0.1:3001;
}
server {
listen 80 default_server;
server_name _;
root /opt/portal/public;
@diago
diago / rma.rb
Created November 15, 2011 15:14
def self.get_with_items( id )
rma = Rma.get( id )
items = rma.items.all
_rma = rma.attributes
_rma[:items] = items
_rma
end
@diago
diago / update_repos.sh
Created November 2, 2011 15:10
Updating all git repos for Redmine
#!/bin/bash
repos=( $(find /opt/repositories -type d -name .git) )
for x in ${repos[@]}; do
cd ${x%.*}
git pull origin master
done
ruby /opt/redmine/script/runner "Repository.fetch_changesets" -e production > /dev/null 2>&1 &
def aliases=( aliases )
return super unless aliases.is_a?( String )
aliases = aliases.split( "\n" ).map do |a|
SiteAlias.first_or_new( name: a )
end
end
# Converts a hash into a query string
#
# Hash keys can be underscored names
# @example
# { :service_type => 'rsemail' }
#
# Or the Rackspace API expected string
#
# @param [Hash, #to_hash] hash to convert
# @return [String] query param
# TMP just for figuring out
post = post.collect do |k,v|
"%s=%s" % [k,v]
end.join('&')
# Instance Methods for ControlPanel::Resources
module ResourceInstanceMethods
def initialize( slug_params = {} )
@slug_params = slug_params
end
def slug
dojo.provide( 'outland.store.JsonRestTreeModel' );
dojo.require( 'dojo.store.JsonRest' );
dojo.declare
( 'outland.store.JsonRestTreeModel'
, [ dojo.store.JsonRest ]
, { idProperty : 'id'