This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Importante: resetear el single_access_token de los usuarios que no tengan | |
cd /var/www/apps/pareja10/current | |
script/console staging (o production) | |
User.find_each do |u| | |
unless u.single_access_token? | |
u.reset_single_access_token | |
u.save(false) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to echobot with XMPP, BOSH, and Strophe | |
1. Setup ejabberd(http://www.ejabberd.im/) server and setup account [email protected] | |
NOTE: localhost should be enough. If you setup something else, make sure you add it at /etc/hosts like this | |
#/etc/hosts | |
127.0.0.1 localhost.local | |
NOTE: Also download Psi(http://psi-im.org/), and make sure you can connect to your ejabberd server. | |
2. Download strophe(http://code.stanziq.com/strophe/) and place it (eg: /Users/makoto/work/sample/strophejs-1.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface NSObject (AMAssociatedObjects) | |
- (void)associateValue:(id)value withKey:(void *)key; // Retains value. | |
- (id)associatedValueForKey:(void *)key; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ImageDiff { | |
// not bigger 20 | |
private $matrix = 15; | |
public function getImageInfo($image_path){ | |
list($width, $height, $type, $attr) = getimagesize($image_path); | |
$image_type = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
app = express(), | |
cookieParser = require('cookie-parser'), | |
session = require('express-session'), | |
RedisStore = require('connect-redis')(session); | |
app.use(express.static(__dirname + '/public')); | |
app.use(function(req, res, next) { | |
if (~req.url.indexOf('favicon')) | |
return res.send(404); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
export INSTANCE_ID=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id` | |
export VOLUME_ID=v-12345678 | |
export EC2_URL=https://ec2.us-east-1.amazonaws.com | |
export EC2_ACCESS_KEY=[key id] | |
export EC2_SECRET_KEY=[key] | |
sudo apt-get install scrub | |
euca-attach-volume -i $INSTANCE_ID -d /dev/sdj $VOLUME_ID |