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
<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
<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
<?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> |
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 | |
# Attempt to load files from production if | |
# they're not in our local version | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule wp-content/uploads/(.*) \ | |
http://{PROD}/wp-content/uploads/$1 [NC,L] | |
</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
# IMPORTANT: if there are another rules, put these ones right after "RewriteEngine on" | |
# Force non-www | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com [NC] | |
RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301] | |
# Force www | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC] |
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 | |
/** | |
* This function fixes string lengths before unserializing a value, | |
* in case some content was found and replaced, for example. | |
* | |
* @param string $str | |
* @param array $options | |
* @return mixed | |
*/ |
NewerOlder