This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for file in *.MP4; do | |
echo "Processing $file..." | |
output="${file%.MP4}-60fps.mp4" | |
ffmpeg -i "$file" -movflags use_metadata_tags -filter:v fps=60 "$output" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Force non-www | |
RewriteCond %{HTTP_HOST} ^www\.foo\.com$ [NC] | |
RewriteRule ^(.*)$ https://foo.com/$1 [L,R=301] | |
# Force SSL | |
RewriteCond %{HTTP_HOST} ^foo\.com$ [NC] | |
RewriteCond %{SERVER_PORT} ^80$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installs extra packages | |
sudo apt-get update | |
sudo apt-get -y install build-essential tcl8.5 | |
# Installs Redis | |
# http://redis.io/topics/quickstart | |
# https://www.digitalocean.com/community/tutorials/how-to-install-and-use-redis | |
# https://realguess.net/2014/07/19/non-interactive-redis-install/ | |
PORT=6379 | |
CONFIG_FILE=/etc/redis/6379.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Try production domain if file doesnt exists | |
RewriteCond %{HTTP_HOST} !^foo\.com [NC] | |
RewriteCond %{REQUEST_FILENAME} !-f [NC] | |
RewriteRule ^uploads/.*$ http://foo.com/$0 [L,NC] | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SimpleCrypt | |
{ | |
protected static $factor = 2 / 3 / 5 / 7 / 11 / 13 / 17 / 19 / 23 / 29; | |
public static function crypt($value) | |
{ | |
$hash = ceil($value / self::$factor); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SimpleApi | |
{ | |
private $baseUrl; | |
public function __construct($baseUrl) | |
{ | |
$this->baseUrl = $baseUrl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl foo bar | python -m json.tool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Force SSL | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
</IfModule> |
NewerOlder