Some basic ffmpeg commands
ffmpeg -i INPUT.mkv INPUT.mp4
/** | |
* take jQuery serializedArray output, and convert the elements which | |
* should be arrays (ie fieldnames[]) and make them arrays | |
*/ | |
var fixSerializedArray = function(arr){ | |
var workObj = {}; | |
var newArr = []; | |
for(var i in arr){ | |
if(workObj.hasOwnProperty(arr[i].name)){ | |
console.log(typeof workObj[arr[i].name]); |
/* Fiddle: https://jsfiddle.net/dmgig/1rhetrhb/ */ | |
(function ( $ ) { | |
var Plugin = function(el){ | |
var plugin = {}; | |
var config = { | |
backgroundColor: 'blue' |
#! /bin/bash | |
# use the archive.org api and 't' tool to tweet random items from an archive.org collection | |
# you'll need two programs preinstalled: | |
# t: A command-line power tool for Twitter. https://github.com/sferik/t | |
# jq: A lightweight and flexible command-line JSON processor. https://stedolan.github.io/jq/ | |
COLLECTION='my_collection' | |
ROWS=1000 | |
ALTVURL='https://archive.org/advancedsearch.php?q=collection:'$COLLECTION'&fl\[\]=identifier,title&rows='$ROWS'&output=json' |
ffmpeg -i INPUT.mkv INPUT.mp4
grep -nr '#[a-fA-F0-9]\{3,6\}' . |
/** | |
* Get points between two points on simple grid. Points must be in a straight line. | |
* Results will include start and end points | |
* | |
* @param A array x, y coordinates of one point | |
* @param B array x, y coordinates of second point | |
* @return false if points are not in a straight line or if points are the same else | |
* array of arrays of x, y coordinates between the two points. | |
* | |
* fixed so that coordinates can be in any direction from each other. |
#!/bin/bah | |
/usr/sbin/screencapture -t jpg -x ~/Desktop/screenshots/$(date +%Y\-%m\-%d\_%H.%M.%S).jpg; | |
find ~/Desktop/screenshots/ -type f -name '*.jpg' -mtime +14 -exec rm {} \; |
<?php | |
$cacheDir = "cache"; | |
$cacheFile = $cacheDir."/data-cache-".md5($_SERVER['QUERY_STRING']).".json"; | |
$generFile = "data-generate.php"; | |
if(!is_writable($cacheDir)){ | |
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500); | |
} |
<?php | |
set_include_path ('/home'); | |
require 'vendor/autoload.php'; | |
\Slim\Slim::registerAutoloader(); | |
const DATALOC = "/home/data"; | |
$allowed_objects = ['tests']; | |
$app = new \Slim\Slim(); |
#!/bin/bash | |
find /path/to/files -type f -exec sed -i "" 's/oldtext/newtext/g' {} \; # find/repalce inside files | |
find /path/to/files -type f -name "*" -exec sh -c 'mv "$0" "${0/oldfilenametext/newfilenametext}"' '{}' \; # find and replace in filenames |