Skip to content

Instantly share code, notes, and snippets.

View MagneticMule's full-sized avatar
🏠
Working from home

Thomas D. Sweeney MagneticMule

🏠
Working from home
  • Seventh Stage
  • Nottingham
View GitHub Profile
@MagneticMule
MagneticMule / composer.json
Created December 6, 2019 11:46
The default I use with new Trellis/Bedrock Wordpres projects
{
"name": "roots/bedrock",
"type": "project",
"license": "MIT",
"description": "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure",
"homepage": "https://roots.io/bedrock/",
"authors": [
{
"name": "Scott Walkinshaw",
"email": "scott.walkinshaw@gmail.com",
@MagneticMule
MagneticMule / ffmpeg_mkv_mp4_conversion.md
Created December 3, 2018 00:23 — forked from jamesmacwhite/ffmpeg_mkv_mp4_conversion.md
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

{
"extends": ["google", "prettier", "prettier/react"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"impliedStrict": true,
"classes": true
}
@MagneticMule
MagneticMule / .eslintrc
Created November 20, 2017 11:50
extends airbnb prettier.txt via Wes Bos
{
"extends": [
"airbnb",
"prettier",
"prettier/react"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
@MagneticMule
MagneticMule / phpdebugon.sh
Last active November 16, 2017 17:03
Enables echoing php errors to the browser
echo "php_flag display_errors 1" > .htaccess
/**
* menu-scroll.js
*
* "Locks" the menu div when it reaches the top of the page. Relies on the class .fixed to the menu bar div
*.fixed {
* position: fixed
* top: 0;
* left: 0;
*}
*/
@MagneticMule
MagneticMule / .gitignore
Created January 31, 2016 14:46 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock -t jwilder/nginx-proxy
def read_file(file_name):
"""reads a file in to memory,
first checking the user has access rights to the file"""
try:
fp = open(file_name, 'r')
except IOError as e:
if e.errno == errno.EACCES:
return False
raise
else:
def hash(s):
"""returns an MD5 hash of the passed string s
We have to encode the passed string as ascii """
hash = ''
if s is not None:
hash = hashlib.md5(s.encode('ascii', 'ignore')).hexdigest()
return hash