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
let imageRef1 = self.backgroundView?.image?.CGImage | |
let coreImage1 = CIImage(CGImage: imageRef1) | |
let imageRef2 = image?.CGImage | |
let coreImage2 = CIImage(CGImage: imageRef2) | |
let coreImage3 = coreImage1.imageByApplyingFilter("CIColorBlendMode", withInputParameters: ["inputBackgroundImage" : coreImage2]) | |
self.imageView?.image = UIImage(CIImage: coreImage3) |
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
# get the actual directory | |
root_path = Dir.pwd | |
# all files on the actual directory | |
Dir.glob(File.join root_path, '*').each do |file| | |
# check that is a directory | |
if File.directory? file | |
print "Converting #{file}... " | |
# path where image files are |
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
adb shell reboot bootloader | |
fastboot boot recovery-RA-hero-v1.7.0.1.img | |
adb shell mount /sdcard | |
adb push recovery-RA-hero-v1.7.0.1.img /sdcard/recovery-RA-hero-v1.7.0.1.img | |
adb shell flash_image recovery /sdcard/recovery-RA-hero-v1.7.0.1.img | |
adb shell reboot |
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 admin@localhost.local | |
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
function auto_link_text($text) { | |
$regexp = '/ | |
( # leading text | |
<\w+.*?>| # leading HTML tag, or | |
[^=!:\'"\/]| # leading punctuation, or | |
^ # beginning of line | |
) | |
( | |
(?:https?:\/\/)| # protocol spec, or | |
(?:www\.) # www.* |
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
# place this code on http-vhost.conf file | |
UseCanonicalName Off | |
VirtualDocumentRoot /Users/MY_USER/Documents/%0/web | |
<Location /> | |
AllowOverride All | |
Options +FollowSymLinks | |
</Location> |
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
.DS_Store | |
/web/bundles/ | |
/app/bootstrap* | |
/app/cache/* | |
/app/logs/* | |
/vendor/ | |
/app/config/parameters.ini |
OlderNewer