<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
#!/bin/bash | |
dir=$(pwd) | |
(cd $1 | |
mkdir -p output | |
for i in * | |
do | |
output="output/$(echo $i | sed 's/\..*$/\.mp4/')" |
# Reduce the size of a PDF file | |
# https://askubuntu.com/a/256449/112818 | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output_reduced.pdf input.pdf | |
# Convert a PDF to grayscale colour | |
# https://superuser.com/a/164857/989263 | |
gs \ | |
-sOutputFile=output_gray.pdf \ | |
-sDEVICE=pdfwrite \ | |
-sColorConversionStrategy=Gray \ |
# create hardsubs for a video from a SRT file using FFMPEG | |
# https://stackoverflow.com/a/21369850/1887369 | |
ffmpeg -i video.mp4 -vf "subtitles=subs.srt:force_style='Fontname=Times New Roman,Fontsize=24,PrimaryColour=&H0000ff&'" output.mp4 | |
## to take only a section of the video: | |
ffmpeg -ss 00:02:00 -copyts -i video.mkv -ss 00:02:00 -vf "subtitles=subs.srt:force_style='Fontsize=24,Fontname=Times New Roman'" -to 00:02:30 cut.mp4 | |
# convert the pixel format using the format filter | |
# https://stackoverflow.com/a/54196619/1887369 |
#!/usr/bin/env zsh | |
function today (){ | |
if [[ 0 -eq $# ]]; then | |
lines=10 | |
else | |
lines="$1" | |
fi | |
output=$(fc -lin -$lines) |
#!/bin/sh | |
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" | |
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] | |
then | |
>&2 echo 'ERROR: Invalid installer signature' | |
rm composer-setup.php |
<?php | |
$pattern = '/^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}) \- \- \[([^\]]+)\] "([A-Z]+) ([^" ]+) [^"]*" ([0-9]+) ([0-9]+) "([^"]*)" "([^"]*)"/'; | |
$heads = 'IP, timestamp, method, URI, status, size, referrer, agent' . PHP_EOL; | |
fputs(STDOUT, $heads); | |
while ($entry = fgets(STDIN)) { | |
preg_match($pattern, $entry, $segments); |
<?php | |
// Logs SQL queries as info | |
// Thanks to @ShawnMcCool | |
// Link to the original content by Shawn McCool: | |
// https://github.com/LaravelIO/laravel-io/blob/master/app/filters.php#L71 | |
Event::listen('illuminate.query', function($sql, $bindings) | |
{ | |
foreach ($bindings as $val) { |
#!/bin/bash | |
python2.6 $HOME/bin/youtube-dl -F $1 | |
echo -n "Enter the number of your file format choice: " | |
read format | |
python2.6 $HOME/bin/youtube-dl -t -f $format $1 |
private static function sendDeleteRq($h, $u) { | |
$client = new Client(); | |
$rq = $client->delete($u, array('h' => $h)); | |
$mn = $rq->send(); | |
return $mn; | |
} |