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 |
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
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
<?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
$this | |
->getContainer() | |
->get('mailer') | |
->getTransport() | |
->getSpool() | |
->flushQueue( | |
$this | |
->getContainer() | |
->get('swiftmailer.transport.real') | |
); |
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
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user |
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
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()); |
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
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
curl -OL https://github.com/downloads/mongodb/mongo-php-driver/osx-php5.3-1.0.11.zip |
NewerOlder