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
If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.
Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.
The simplest way to add an alias for a specific git command is to use a standard bash alias.
# .bashrc
By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk.
This process is outlined at the Nginx ngx_http_fastcgi_module page manual page.
<?php | |
/** | |
* Convert a comma separated file into an associated array. | |
* The first row should contain the array keys. | |
* | |
* Example: | |
* | |
* @param string $filename Path to the CSV file | |
* @param string $delimiter The separator used in the file | |
* @return array |
IE9, IE10, and IE11 don't properly scale SVG files added with img
tags when viewBox
, width
and height
attributes are specified. View this codepen on the different browsers.
Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.
As per this answer on Stackoverflow, the issue can be resolved by removing just the width
and height
attributes.
These are some simple bash functions and scripts for making CSV/TSV files prettier on the command line
see http://stefaanlippens.net/pretty-csv.html for more information.
#!/usr/bin/env bash | |
set -e | |
# Dreamhost Mosh Install Script | |
# Jay Williams (https://gist.github.com/jaywilliams/c9ffab789b3f622abc932dd4cfaaeef5) | |
# Based on the gracious work of: | |
# Paul R Alexander (https://gist.github.com/palexander/2975305) | |
# Sami Samhuri https://gist.github.com/samsonjs/4076746 |
{ | |
"monolog": { | |
"title": "Monolog log file", | |
"description": "Monolog log format", | |
"url": "https://github.com/Seldaek/monolog", | |
"regex": { | |
"default": { | |
"pattern": "\\[(?P<timestamp>.*)\\] (?P<logger>\\w+).(?P<level>\\w+): (?P<message>[^\\[\\{]+) (?P<context>[\\[\\{].*[\\]\\}]) (?P<extra>[\\[\\{].*[\\]\\}])" | |
} | |
}, |
# Installing PHP 7.4.33 as CGI/FastCGI on a Pair Networks VPS | |
# By Jay Williams <http://myd3.com/> | |
# Based off of the Pair Users wiki page "Installing PHP5 as cgi" <http://www.pairusers.com/?How%20to%20install%20PHP5> | |
# Note: Replace "USERNAME" with your actual server username | |
# Make src directory in home | |
mkdir ~/src | |
# Download, configure, and compile OpenSSL |
<?php | |
/** | |
* Convert a QuickBooks QBXML Report to HTML/CSV File | |
* | |
* I created this little script to help me read through the raw XML responses | |
* from QuickBooks. I originally built it to export to a CSV file, but found | |
* that a simple HTML table was better suited for my usage. However, I've | |
* included the CSV code below for anyone who may need that functionality. | |
* |