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 android.graphics.Bitmap; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.Drawable; | |
import java.io.ByteArrayOutputStream; | |
/** | |
* Sketch Project Studio | |
* Created by Angga on 12/04/2016 14.27. | |
*/ | |
public class AppHelper { |
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 TusController { | |
public function indexAction() { | |
// Disable views/layout the way suites your framework | |
$server = $this->_getTusServer(); | |
$response = $server->serve(); | |
$this->_fixNonSecureLocationHeader($response); | |
$response->send(); |
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 TusController { | |
public function indexAction() { | |
// Disable views/layout the way suites your framework | |
$server = new TusPhp\Tus\Server(); // Using File Cache (over Redis) for simpler setup | |
$server->setApiPath('/tus/index') // tus server endpoint. | |
->setUploadDir('/tmp'); // uploads dir. | |
$response = $server->serve(); |
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 FileController { | |
public function postAction() { | |
// Disable views/layout the way suites your framework | |
if (!isset($_FILES['imageFile'])) { | |
// Throw an exception or handle it your way | |
} | |
// Nginx already did all the work for us, & received the file in the `/tmp` folder | |
$uploadedFile = $_FILES['imageFile']; | |
$OriginalFileName = $uploadedFile['name']; |
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 | |
/** | |
* appending campaign parameters to every single link `<a href=''></a>` | |
* in the given $bodyHtml | |
* | |
* @param type $bodyHtml | |
*/ | |
public function appendCampaignPrameters($bodyHtml, $utmCampaign) { | |
$newParams = [ |
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 android.hardware.Sensor; | |
import android.hardware.SensorEvent; | |
import android.hardware.SensorEventListener; | |
import android.hardware.SensorManager; | |
import android.media.ExifInterface; | |
/** | |
* Created by abdelhady on 9/23/14. | |
* | |
* to use this class do the following 3 steps in your activity: |