Skip to content

Instantly share code, notes, and snippets.

@nmaggioni
nmaggioni / ufw_plex.md
Last active May 10, 2024 23:00 — forked from andrey-str/ufw plexmediaserver app profile.md
Plex Media Server UFW rule

/etc/ufw/applications.d/plexmediaserver

[plexmediaserver]
title=Plex Media Server (Standard)
description=The Plex Media Server
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp

[plexmediaserver-dlna]
title=Plex Media Server (DLNA)
description=The Plex Media Server (additional DLNA capability only)
var _ = require('lodash')
_.each(
_.uniqBy(_.flatMap(
_.merge(_.groupBy(_.keys(_), _.head), _.groupBy(_.keys(_), _.last)),
_.rearg(_.over(_.identity, _.toUpper), _.toInteger(_.stubTrue()))
)),
_.flow(
_.over(_.stubObject, _.identity, _.constant),
_.spread(_.set),
@abbotto
abbotto / nest.sh
Last active October 7, 2016 11:30
NodeJS Environment Setup Tasks
#!/bin/bash
printf "\n-----------------------------------------\n"
printf "N.E.S.T.\n"
printf "NodeJS Environment Setup Tasks"
printf "\n-----------------------------------------\n"
# Requires nvm and nodejs
# Put this in the same folder as "package.json"
@hako
hako / sirius-diy-tutorial.md
Last active December 15, 2021 14:29
Installing Sirius on Mac / Linux / Raspberry Pi

Installing Sirius on Mac / Linux / Raspberry Pi

Tested working on:

  • Raspberry Pi 1 Model B+ (Using Docker hypriot/rpi-python) (debian/wheezy)
  • Raspberry Pi 2 Model B (with virtualenv)
  • Ubuntu Linux x64 (with virtualenv)
  • Ubuntu Linux x64 (Using Docker)
  • OS X Yosemite (with virtualenv)
@abbotto
abbotto / xhrBinary.js
Last active April 26, 2024 08:13
Get binary data with XHR in most browsers including IE8+
/*!
* xhrBinary.js
* Author: Jared Abbott
* Copyright 2015 Jared Abbott
* Distributed under the MIT license
*/
var xhrBinary = function(url, fn) {
// RESOURCES
// http://mgran.blogspot.com/2006/08/downloading-binary-streams-with.html
@paulirish
paulirish / what-forces-layout.md
Last active May 23, 2024 14:12
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@abbotto
abbotto / antergos_change_apache_webroot
Last active October 18, 2016 17:30
Antergos - Change Apache Webroot
INSTALL:
sudo pacman --noconfirm -S apache php php-apache
RUN THIS COMMAND:
sudo nano /etc/httpd/conf/httpd.conf
EDIT THESE LINES IN THE /etc/httpd/conf/httpd.conf FILE:
- Add: LoadModule php5_module modules/libphp5.so
- Add: Include conf/extra/php5_module.conf
- Update: ServerName localhost:80
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active May 16, 2024 13:16
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@derhuerst
derhuerst / video-to-web.sh
Created April 1, 2015 11:12
Convert any video to WebM and MP4 for HTML5 video
#!/bin/bash
# This script takes any (high resolution) video file as input and converts it to WebM (VP8 & Vorbis) and MP4 (H264 & AAC) for HTML5 <video>. For each format, it creates a high quality (`-hq`) and a low quality (`-lq`) version.
# ffmpeg has to be installed, see http://docs.sublimevideo.net/encode-videos-for-the-web for more instructions.
# Usage: videoToWeb.sh <inputfile>
# This is heavily inspired by
# - https://github.com/kornl/video-conversion/blob/master/convert_video_for_html_5.sh
# - https://github.com/mickro/video2html5/blob/master/video2html5.sh
# - http://diveintohtml5.info/video.html#webm-cli
# NOTICE: SSH ACCESS REQUIRED
# INSTALL nano AS AN ALTERNATIVE TO vi
opkg install nano
# PASTE THIS INTO /etc/rc.local BEFORE exit 0
sed -i -e `$i \logger _____Initializing the blocklist... &\n` /etc/rc.local
sed -i -e `$i \wget -O - "http://pgl.yoyo.org/as/serverlist.php?hostformat=dnsmasq&mimetype=plaintext" | sed 's/127.0.0.1/192.168.1.254/g' | grep -vE 'example.com' > /etc/dnsmasq.conf && /etc/init.d/dnsmasq restart &\n` /etc/rc.local
# CREATE /tmp/block.init