Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
# Add to nginx.conf http section | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} |
This example demonstrates how to use gradients in SVG, defining the stop colors completely via CSS. The advantage of this approach is that we can use gradients in shapes without having to hardcode the stop-color
attributes when defining the gradients in the SVG element.
var User = (function () { | |
function User (id, nam) { | |
var self = this; | |
this.id = id; | |
this.nam = nam; | |
this.__data = {}; | |
for(var p in self) { |
$INPUTVIDEO='input.mp4' | |
$OUTPUTVIDEO='output.mp4' | |
ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO |
/* | |
* AWS Sdk KMS spike: (assuming node v6.6+) | |
* 1 - Create master key at KMS | |
* 2 - Copy alias or ARN | |
* 3 - run this i.e. | |
* $ node spike.js KEY_ALIAS YOUR_PLAINTEXT_TO_ENCRYPT | |
*/ | |
const AWS = require('aws-sdk'); | |
// aws-sdk is not reading my region info so i'll have to set it here |
Brought to you by Headjack
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.
Let's start with some basics:
ffmpeg
calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file'use strict'; | |
const Memwatch = require('memwatch-next'); | |
const Util = require('util'); | |
if (Config.env === 'production') { | |
/** | |
* Check for memory leaks | |
*/ | |
let hd = null; | |
Memwatch.on('leak', (info) => { |
There is no problem with being a noobie and I do not use the term to sligtht or disparage anyone.
This is a way to setup your permissions for running Plex in Linux. Different folks may use different methods.
The permissions concepts provided here apply to OSX, but the users and groups are controlled and modified differently, so much of this will not work properly. I think the command is dscl
, but that could be out of date.
There are many ways to setup your permissions scheme in Linux, this methodology describes a way to do it, not everyone will like it, but it works for me, so whatever.
If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.