Skip to main content

Posts

Showing posts from August, 2019

INSTALL FFMPEG

  https://sites.duke.edu/ddmc/2013/12/30/install-ffmpeg-on-a-mac/ The easiest way to install ffmpeg is to use HomeBrew a package manager for Mac. If you don’t have homebrew installed on your mac already,  run the following command using terminal: `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ; Once you have Homebrew installed, you can now simply install ffmpeg from terminal with the following command: `brew install ffmpeg`

DELETE MULTIPLE FILES PHP

$path = $_SERVER['DOCUMENT_ROOT'].'/uploads/'; function deleteFiles($path){ $files = glob($path.'*'); // get all file names foreach($files as $file){ // iterate files if(is_file($file)) unlink($file); // delete file  //echo $file.'file deleted'; } }

PHP MAGIC CONSTANTS

PHP has large number of predefined constants. This HOWTO will present the seven most important, most practical and most useful PHP Magic Constants. FILE – The full path and filename of the file. DIR – The directory of the file. FUNCTION – The function name. CLASS – The class name. METHOD – The class method name. LINE – The current line number of the file. NAMESPACE – The name of the current namespace

GET SUBSTRING OF STRING WITH POSITION

$filename = " abcd.mp 4"; if (($pos = strpos($filename, ".")) !== FALSE) {           $whatIWant = substr($filename, $pos); echo $whatIWant; // .mp4        } VICEVERSA  $arr = explode(".", $filename, 2);        $first = $arr[0]; *************************************** if (($pos = strpos($filename, ".")) !== FALSE) {             $extension = substr($filename, $pos);         }        if(($arr = explode(".", $filename, 2)) !== FALSE){            $name = $arr[0];      }

COLOR CODES

COLORS aliceblue (#f0f8ff) antiquewhite (#faebd7) aqua (#00ffff) aquamarine (#7fffd4) azure (#f0ffff) beige (#f5f5dc) bisque (#ffe4c4) black (#000000) blanchedalmond (#ffebcd) blue (#0000ff) blueviolet (#8a2be2) brown (#a52a2a) burlywood (#deb887) cadetblue (#5f9ea0) chartreuse (#7fff00) chocolate (#d2691e) coral (#ff7f50) cornflowerblue (#6495ed) cornsilk (#fff8dc) crimson (#dc143c) cyan (#00ffff) darkblue (#00008b) darkcyan (#008b8b) darkgoldenrod (#b8860b) darkgray (#a9a9a9) darkgreen (#006400) darkgrey (#a9a9a9) darkkhaki (#bdb76b) darkmagenta (#8b008b) darkolivegreen (#556b2f) darkorange (#ff8c00) darkorchid (#9932cc) darkred (#8b0000) darksalmon (#e9967a) darkseagreen (#8fbc8f) darkslateblue (#483d8b) darkslategrey (#2f4f4f) darkturquoise (#00ced1) darkviolet (#9400d3) deeppink (#ff1493) deepskyblue (#00bfff) dimgray (#696969) dimgrey (#696969) dodgerblue (#1e90ff) firebrick (#b22222) floralwhite (#fffaf0) forestgreen (#228b22) fu...

React Native

COMMAND FOR BUNDLE : To genrate debug APK in android: 1.Go to project folder in terminal 2.Run this command :(if you have index.js in project root then run )* prefered react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res or (if you have index.android.js in project root then run ) react-native bundle --dev false --platform android --entry-file index.android.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug 3.Create debug apk: (i) cd android/ (ii) ./gradlew assembleDebug REACT NATIVE APP : https://github.com/ReactNativeNews/React-Native-Apps OBJECT KEYS : The `Object.keys()` method returns an array of a given object's own property `names`, in the same order as we get with a normal loop. const object1 = { a: 'somestring...

Video To Thumbnail

Create Thumbnail of video using ffmpeg library. HTML <! DOCTYPE html > < html lang = "en" > < head > < title >Video2Thumbnail</ title > < meta charset = "utf-8" > < meta name = "viewport" content = "width=device-width, initial-scale=1" > < link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css" > < script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js" ></ script > < script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js" ></ script > </ head > < body > < div class = "container" > < div class = "row" > < h1 class = "bg-info" > VIDEO 2 THUMBNAIL </ h1 > < form class = "form-inline" action = "test.php" ...

HTML to pdf

< html > < head > < title > CANVAS </ title > <!-- Latest compiled and minified CSS --> < link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css" > <!-- jQuery library --> < script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js" > < / script > <!-- Latest compiled JavaScript --> < script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js" > < / script > < script src = "//cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.3/jspdf.min.js" > < / script > </ head > < body > < div class = "container" > < div class = "row" > < div id = "myCanvas" style = " background : white" > < div class = "alert alert-success" > ...