Skip to content

Instantly share code, notes, and snippets.

View rodrigorm's full-sized avatar

Rodrigo Moyle rodrigorm

  • Santos/SP - Brazil
View GitHub Profile
@rodrigorm
rodrigorm / index.html
Created February 19, 2009 22:12
How to load a production app in javascriptmvc.com without using document.write()
<html>
<head></head>
<body>
<script language="javascript" type="text/javascript" src="../../jmvc/include.js"></script>
<script type="text/javascript" charset="utf-8">
first_wave_done = false;
MVC.apps_root = MVC.root.join('apps');
MVC.app_name = 'hello_world';
MVC.Options.load_production = false;
include.setup({
#!/bin/bash
projects=( rails active_merchant activerecord_i18n_defaults adva_cms amqp ansuz apache-upload-progress-module backports braid click-to-globalize clj-garden cucumber cucumber-tmbundle custom_resource_name deprec design_patterns_in_ruby exception_notification git-me-up git_depot globalize2 globalize2-demo grit http_accept_language insoshi isitjruby jrails jruby-rack lighthouse-api merb-internals-handbook mizuho mspec panda paperclip poignant-br prawn rails-template rake-compiler reia rhodes rhosync rquery rspec rspec-rails ruby-benchmark-suite rubyspec sake-tasks saushengine scanty snippets standalone-migrations translate_routes translator twitter vim-git vim-rails webrat )
for repo in ${projects[@]}; do
echo "Updating repo [$repo]"
cd /Users/akitaonrails/Sites/rails/$repo
git checkout master
git pull
done
function fetch {
mysqldump -h oldhost -u oldusername -poldpassword olddbname | mysql -h newhost -u newusername -pnewpassword newdbname
class AppInflector extends Inflector {
function slug($string, $replacement = '_') {
$map = array(
'ã' => 'a',
'õ' => 'o'
);
$string = str_replace(array_keys($map), array_values($map), $string);
return Inflector::slug($string, $replacement);
}
}
<?php
uses('folder');
uses('file');
class SmushitShell extends Shell {
const service = 'http://smush.it/';
function main() {
$root = $this->params['root'] . DS;
$src = $this->args[0];
@rodrigorm
rodrigorm / .bashrc
Created September 17, 2010 15:00
My terminal profile
export PATH=~/bin:$PATH
DISPLAY=:0.0
export HISTCONTROL=erasedups
export HISTSIZE=10000
shopt -s histappend
source ~/.git-completion.sh
PS1='[\u@\h \W]\n\W$(__git_ps1 " (%s)")\$ '
@rodrigorm
rodrigorm / css.php
Created November 23, 2010 13:49
CakePHP CSS and JS preprocessor
<?php
/**
* CSS Functions
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
@rodrigorm
rodrigorm / build.xml
Created March 16, 2011 12:52
Ant build i'm using on CakePHP projects + Hudson CI
<project name="CakePHP" default="build">
<target name="clean">
<delete dir="build" />
</target>
<target name="prepare">
<mkdir dir="build/junit" />
<mkdir dir="build/logs" />
<chmod perm="a+rw">
<fileset dir="app/tmp" />
@rodrigorm
rodrigorm / README.md
Created August 8, 2011 01:43
Configuration file to use PHP with Ruby rack

Installation

First you need php-cgi, i used brew with Formula below:

$ curl -O https://gist.github.com/raw/1131062/7ae1709453a8a19ce9c030bf41d544dd08d96d85/php.rb
$ mv php.rb `brew --prefix`/Library/Formula
$ brew install php --with-mysql

Second, install this ruby gems:

@rodrigorm
rodrigorm / feed.xml
Created April 11, 2012 15:41
Hintee XML Feed for Stores
<?xml version="1.0" encoding="utf-8"?>
<products>
<!--
Product Definition:
* name: required, product name as show in the page
* url: required, url used to buy the product
-->
<product name="T-shirt Name" url="http://example.com/product?id=999">
<!--
Image Definition: