Skip to content

Instantly share code, notes, and snippets.

@davidtron
davidtron / transcode-toh264.md
Last active January 19, 2024 12:22
Transcode h265 down to h264 on OSX using ffmpeg
  • Install brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Install ffmpeg with h265 and h264 libraries
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265 --with-x264
  • I want to transcode the video from h265 to h264 and copy the audio stream without re-encoding, there's multiple streams in the source mkv
@chriscct7
chriscct7 / gist:d7d077afb01011b1839d
Last active January 24, 2024 04:20
Plugins that need to be updated to be ready for the move to PHP 5 constructors

Important Notice for WordPress Plugins Using PHP 4 Style Constructors

The ability to use PHP 4 style constructors is getting removed from PHP. Without an update, many plugins will eventually no longer work (this is PHP breaking this backwards compatibility, not WordPress)

One of the more common uses of the PHP 4 style constructor (as opposed to PHP 5 style __construct() ) are plugins with widgets calling WP_Widget::WP_Widget() and/or parent::WP_Widget() and/or {object}->WP_Widget()

Note: Starting in WordPress 4.3, regardless of the PHP version in use on a server, WordPress will throw a deprecated notice when one of the PHP 4 style constructors is called specifically for widgets.

Basically instead of doing these:

@eduardocardoso
eduardocardoso / gist:82a629882ddb02ab3677
Last active April 3, 2023 08:23
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@chris-rock
chris-rock / crypto-buffer.js
Last active November 24, 2023 09:48
Encrypt and decrypt buffers in nodejs
// Part of https://github.com/chris-rock/node-crypto-examples
var crypto = require('crypto'),
algorithm = 'aes-256-ctr',
password = 'd6F3Efeq';
function encrypt(buffer){
var cipher = crypto.createCipher(algorithm,password)
var crypted = Buffer.concat([cipher.update(buffer),cipher.final()]);
return crypted;
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@andytlr
andytlr / _description.md
Last active August 1, 2023 08:02
Convert SVG <polyline> to <path> so they can be animated with D3 etc.

Convert SVG polyline to path

Replace all instances of <polyline with <path and points=" with d="M.

 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1000px" height="1000px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
-<polyline fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" points="100.712,141.534 582.904,227.835 425.37,478.521
+
@dariodiaz
dariodiaz / gulpfile.js
Created January 30, 2014 03:33 — forked from laracasts/gulpfile.js
laravel: gulp config for laravel
var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var autoprefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css')
var coffee = require('gulp-coffee');
var exec = require('child_process').exec;
var sys = require('sys');
@firepol
firepol / bootstrap_ms.css
Last active September 23, 2020 19:14 — forked from andyl/bootstrap_ms.css
updated max-width: 767px to avoid breaking the existing behavior on col-sm
.col-ms-1,
.col-ms-2,
.col-ms-3,
.col-ms-4,
.col-ms-5,
.col-ms-6,
.col-ms-7,
.col-ms-8,
.col-ms-9,
.col-ms-10,
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.