Skip to content

Instantly share code, notes, and snippets.

@sander1
sander1 / README.txt
Created December 5, 2010 17:41 — forked from rmm5t/README.md
You can represent time statements in most western languages where
a prefix and/or suffix is used.
The default case is to use suffix only (as in English), which you
do by providing the `suffixAgo` and `suffixFromNow` settings in
the strings hash (earlier versions of timeago used the deprecated
`ago` and `fromNow` options). If present, they are used.
2 minutes [suffixAgo]
2 minutes [suffixFromNow]
{
"AF": "Afghanistan",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
"AG": "Antigua and Barbuda",
#!/bin/bash
mkdir ts
mkdir ts/640x360
mkdir ts/960x540
mkdir ts/1280x720
./ffmpeg -y -i input.mp4 -c:a aac -strict experimental -ac 2 -b:a 96k -ar 44100 -c:v libx264 -pix_fmt yuv420p -profile:v baseline -level 3.1 -maxrate 1M -bufsize 3M -crf 18 -r 25 -g 72 -f hls -hls_time 9 -hls_list_size 0 -s 640x360 -hls_segment_filename 'ts/640x360/segment%02d.ts' ts/640x360/prog_index.m3u8
./ffmpeg -y -i input.mp4 -c:a aac -strict experimental -ac 2 -b:a 96k -ar 44100 -c:v libx264 -pix_fmt yuv420p -profile:v main -level 3.1 -maxrate 2M -bufsize 4M -crf 18 -r 25 -g 72 -f hls -hls_time 9 -hls_list_size 0 -s 960x540 -hls_segment_filename 'ts/960x540/segment%02d.ts' ts/960x540/prog_index.m3u8
./ffmpeg -y -i input.mp4 -c:a aac -strict experimental -ac 2 -b:a 96k -ar 44100 -c:v libx264 -pix_fmt yuv420p -profile:v main -level 3.1 -maxrate 3M -bufsize 6M -crf 18 -r 25 -g 72 -f hls -hls_time 9 -hls_list_size 0 -s 1280x720 -hls_segment_filename 'ts/1280x720/segment%02d.ts' ts/1280x720/prog_index.m3u8
@sander1
sander1 / gist:89ffe7a1ed37031168781e70e740ebbf
Created August 10, 2016 21:42
nginx: link to minified css/js if available
location ~ ^(.+)\.(css|js)$ {
try_files $1.min.$2 $uri =404;
}
wget --no-check-certificate https://github.com/rafa3d/vHWINFO/raw/master/vhwinfo.sh -O - -o /dev/null|bash
@sander1
sander1 / notify_newip_short.py
Last active February 15, 2017 13:47 — forked from blacktwin/notify_newip_short.py
If IP address is new use Pushover Agent (agent_id =7)
# 1. Install the requests module for python.
# pip install requests
# 2. Add script arguments in PlexPy.
# {user} {user_id} {ip_address}
import requests
import sys
user = sys.argv[1]
user_id = sys.argv[2]
@sander1
sander1 / gist:08f12332d85bd87b3143c5b2058a5387
Created February 17, 2017 14:20
WordPress: Hide Author Usernames
add_action('template_redirect', 'bwp_template_redirect');
function bwp_template_redirect() {
if (is_author()) {
wp_redirect(home_url());
exit;
}
}
@sander1
sander1 / gist:c8dd59792597bed18cbe1d14604ff369
Created February 17, 2017 14:23
WordPress: Cleanup Head Tag
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'wp_shortlink_wp_head');
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'feed_links_extra', 3);
@sander1
sander1 / gist:e7bd6d5c1445667fbba8991d44cf9f0e
Created February 17, 2017 14:24
WordPress: Disable JSON REST API
add_filter('json_enabled', '__return_false');
add_filter('json_jsonp_enabled', '__return_false');
remove_action('wp_head', 'rest_output_link_wp_head', 10);
remove_action('template_redirect', 'rest_output_link_header', 11, 0);
@sander1
sander1 / gist:e38b7fa7686468646c8edc765232511f
Created February 17, 2017 14:25
WordPress: Change Mail From and Return Path
add_filter('wp_mail_from', function($email) {
return 'you@your-domain.com';
});
add_filter('wp_mail_from_name', function($name) {
return get_option('blogname');
});
class email_return_path {
function __construct() {