Skip to content

Instantly share code, notes, and snippets.

View ecentinela's full-sized avatar

Javier Martínez Fernández ecentinela

  • Barcelona, Spain
View GitHub Profile
@ecentinela
ecentinela / coffee-script-on-sublime-text.sh
Created February 28, 2012 08:52
Install CoffeeScript support for SublimeText
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript
echo "{"cmd": ["coffee", "-c", "$file"], "selector": "source.coffee", "path": "/usr/local/bin"}" > ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/CoffeeScript.sublime-build
@ecentinela
ecentinela / jmvc3.2.2
Created February 24, 2012 09:13
jmvc3.2.2
(function( $ ) {
// Several of the methods in this plugin use code adapated from Prototype
// Prototype JavaScript framework, version 1.6.0.1
// (c) 2005-2007 Sam Stephenson
var regs = {
undHash: /_|-/,
colons: /::/,
words: /([A-Z]+)([A-Z][a-z])/g,
lowUp: /([a-z\d])([A-Z])/g,
dash: /([a-z\d])([A-Z])/g,
@ecentinela
ecentinela / eclipse_fullscreen_lion
Created January 12, 2012 21:17
Fullscreen for Eclipse on Lion
Help -> Install New Software -> Add -> http://github.bandlem.com/
@ecentinela
ecentinela / php_unit_on_mamp.sh
Created January 12, 2012 19:38
PHPUnit MAMP
cd /Applications/MAMP/bin/php/php5.3.6/bin
# upgrade pear
sudo ./pear upgrade pear
# If you get the next error, move the pear.conf file, and rerun the pear upgrade
# Notice: unserialize(): Error at offset 276 of 1133 bytes in Config.php on line 1050
# ERROR: The default config file is not a valid config file or is corrupted.
mv /Applications/MAMP/bin/php/php5.3.6/conf/pear.conf /Applications/MAMP/bin/php/php5.3.6/conf/pear.conf.old
sudo ./pear upgrade pear
@ecentinela
ecentinela / NSObject+AssociatedObjects.h
Created December 23, 2011 18:33 — forked from xslim/NSObject+AssociatedObjects.h
Blocks support for RestKit RKClient
#import <Foundation/Foundation.h>
@interface NSObject (AMAssociatedObjects)
- (void)associateValue:(id)value withKey:(void *)key; // Retains value.
- (id)associatedValueForKey:(void *)key;
@end
@ecentinela
ecentinela / gist:1395452
Created November 26, 2011 10:55
gitignore for symfony
.DS_Store
/web/bundles/
/app/bootstrap*
/app/cache/*
/app/logs/*
/vendor/
/app/config/parameters.ini
@ecentinela
ecentinela / gist:1299236
Created October 19, 2011 18:39
universal virtual hosts for apache
# place this code on http-vhost.conf file
UseCanonicalName Off
VirtualDocumentRoot /Users/MY_USER/Documents/%0/web
<Location />
AllowOverride All
Options +FollowSymLinks
</Location>
@ecentinela
ecentinela / imagick
Created October 19, 2011 18:14
install imagick on mamp 2 - lion
# install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
# install imagemagick
brew install imagemagick
# install imagick
brew install imagick
# if giving errors on the installation, comment the content on ~/.bash_profile or ~/.profile, open a new terminal and retry
@ecentinela
ecentinela / gist:1275450
Created October 10, 2011 14:25 — forked from javan/gist:1168475
Fix iPhone home button
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/
1.) Open any application
2.) Press and hold the power button until the slide to shutdown swipe bar appears.
3.) Release Power button
4.) Press and hold Home button Lightly
until screen returns to icon screen
@ecentinela
ecentinela / phpunit
Created May 26, 2011 16:56
Install PHPUnit in MAMP
cd /Applications/MAMP/bin
ln -s php5.3 php5
php5/bin/pear channel-discover pear.phpunit.de
php5/bin/pear channel-discover components.ez.no
php5/bin/pear channel-discover pear.symfony-project.com
php5/bin/pear channel-update pear.php.net
php5/bin/pear upgrade pear
php5/bin/pear install phpunit/PHPUnit
ln -s /Applications/MAMP/bin/php5/bin/phpunit /usr/local/bin/phpunit
phpunit --version