Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus| <?php | |
| /* usage: | |
| $db = new Database("mysql:host=" . Config::$dbHost . ";dbname=" . Config::$dbName . ";", Config::$dbName, Config::$dbUser, Config::$dbPass); | |
| $db->changeVersion("", "1", function ($tx) { | |
| $tx->executeSql("CREATE TABLE IF NOT EXISTS `examples` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `example` mediumtext, | |
| PRIMARY KEY (`id`) |
| <form action="." method="post"> | |
| <noscript>You must <a href="http://www.enable-javascript.com" target="_blank">enable JavaScript</a> in your web browser in order to pay via Stripe.</noscript> | |
| <input | |
| type="submit" | |
| value="Pay with Card" | |
| data-key="PUBLISHABLE STRIPE KEY" | |
| data-amount="500" | |
| data-currency="cad" | |
| data-name="Example Company Inc" |
| <div><!-- social media share buttons --> | |
| <a href="http://www.facebook.com/" onclick="window.location = 'http://www.facebook.com/share.php?u=' + encodeURIComponent(window.location); return false"><img src="http://i.imgur.com/aLnZg.png" alt="Share on Facebook" border="0" /></a> | |
| <a href="http://twitter.com/" onclick="window.location = 'http://twitter.com/home/?status=' + encodeURIComponent(window.location); return false"><img src="http://i.imgur.com/oFrLG.png" alt="Tweet This" border="0" /></a> | |
| <a href="http://www.linkedin.com/" onclick="window.location = 'http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(window.location); return false"><img src="http://i.imgur.com/mwHNU.png" alt="Share on LinkedIn" border="0" /></a> | |
| <a href="https://plus.google.com/" onclick="window.location = 'https://plus.google.com/share?url=' + encodeURIComponent(window.location); return false"><img src="http://i.imgur.com/tzMMp.png" alt="Share on Google+" border="0" /></a> |
| // With $script variable | |
| $(document).ready(function() { | |
| $('script[type="text/javascript/defer"]').each(function() { | |
| var $script = $('<script type="text/javascript"/>').text($(this).clone().text()); | |
| $(this).after($script).remove(); | |
| }); | |
| }); | |
| // Without $script variable | |
| $(document).ready(function() { |
| <?php | |
| /** | |
| * ----------------------------------------------------------------------------------------- | |
| * Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php` | |
| * ----------------------------------------------------------------------------------------- | |
| */ | |
| // HTML Minifier | |
| function minify_html($input) { |
| ##################### | |
| # | |
| # Use this with or without the .gitattributes snippet with this Gist | |
| # create a fixle.sh file, paste this in and run it. | |
| # Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF) | |
| # This Gist normalizes handling by forcing everything to use Unix style. | |
| ##################### | |
| # Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF |
| /** | |
| * Prevent update notification for plugin | |
| * http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/ | |
| * Place in theme functions.php or at bottom of wp-config.php | |
| */ | |
| function disable_plugin_updates( $value ) { | |
| if ( isset($value) && is_object($value) ) { | |
| if ( isset( $value->response['plugin-folder/plugin.php'] ) ) { | |
| unset( $value->response['plugin-folder/plugin.php'] ); | |
| } |
| #!/bin/bash | |
| # | |
| # This script configures WordPress file permissions based on recommendations | |
| # from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
| # | |
| # Author: Michael Conigliaro | |
| # | |
| WP_OWNER=changeme # <-- wordpress owner | |
| WP_GROUP=changeme # <-- wordpress group | |
| WP_ROOT=/home/changeme # <-- wordpress root directory |
| <!-- What is Functions File in WordPress? --> | |
| <!-- Functions file commonly known as functions.php file is a WordPress theme file. | |
| It comes with all free and premium WordPress themes. | |
| The purpose of this file is to allow theme developers to define theme features and functions. This file acts just like a WordPress plugin and can be used to add your own custom code snippets in WordPress. | |
| You would find many of these code snippets on websites like https://deardorffassociatesweb.wordpress.com/ with instructions telling you to add this code in your theme’s functions.php file or a site-specific WordPress plugin. | |
| Now you may be thinking what’s the difference between a site-specific WordPress plugin and functions.php file? Which one is better? |