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 / 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 / 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 / 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 / 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 / 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 / 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 / php-mongo.sh
Created March 10, 2012 12:06
php mongo extension
curl -OL https://github.com/downloads/mongodb/mongo-php-driver/osx-php5.3-1.0.11.zip
@ecentinela
ecentinela / behat-jenkins.txt
Created March 17, 2012 09:29 — forked from robo47/behat-jenkins.txt
Behat, Symfony2, Jenkins
Ant-Task which runs behat:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Foo" default="build" basedir=".">
....
<target name="behat">
<exec dir="${basedir}/" executable="php" failonerror="true">
@ecentinela
ecentinela / linkify.php
Created March 27, 2012 05:06 — forked from jasny/linkify.php
PHP function to turn all URLs in clickable links
<?php
/**
* Turn all URLs in clickable links.
*
* @param string $value
* @param array $protocols http/https, ftp, mail, twitter
* @param array $attributes
* @param string $mode normal or all
* @return string
*/
@ecentinela
ecentinela / android_application_signature.java
Created December 5, 2012 20:11
Get Android application signature
PackageInfo info;
try {
info = getPackageManager().getPackageInfo("ecentinela.mercadotes", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());