Skip to content

Instantly share code, notes, and snippets.

View Jibbarth's full-sized avatar
🌴

Jibé Barth Jibbarth

🌴
View GitHub Profile
@Jibbarth
Jibbarth / convertPdf.php
Created June 1, 2017 13:24
Convert pdf / PHP / Imagick
$sPathName = realpath($oFile->getPathname());
$oIm = new Imagick($sPathName);
$iNoOfPagesInPDF = $oIm->getNumberImages();
if ($iNoOfPagesInPDF) {
$aPdfPagePath = [];
for ($i = 0; $i < $iNoOfPagesInPDF; $i++) {
$sUrl = $sPathName . '[' . $i . ']';
$sPath = '/tmp/' . $oFile->getFilename() . '_' . ($i + 1) . '.pdf';
@Jibbarth
Jibbarth / ieVersion.js
Last active April 4, 2017 10:14
Get Internet Explorer version and get is Edge Navigator in javascript
/**
* Gets the internet explorer version.
*
* @return {int} The internet explorer version.
*/
function getInternetExplorerVersion() {
var rv = -1;
if (navigator.appName == 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;
@Jibbarth
Jibbarth / convert_mov_to_mp4.sh
Created November 28, 2016 13:46
Convert mov to mp4 with ffmpeg preserving modification time
#!/bin/bash
for file in *.MOV; do
ffmpeg -i "$file" -vcodec copy -acodec copy "${file%.MOV}".mp4
touch -r "$file" "${file%.MOV}".mp4
done