Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Jake Wilson Jakobud

  • Fort Collins, Colorado
View GitHub Profile
@Jakobud
Jakobud / client.conf
Last active Dec 28, 2017
OpenVPN PIA configuration
View client.conf
client
dev tun
proto udp
remote us-california.privateinternetaccess.com 1198
remote us-east.privateinternetaccess.com 1198
remote us-west.privateinternetaccess.com 1198
remote us-siliconvalley.privateinternetaccess.com 1198
remote us-texas.privateinternetaccess.com 1198
remote us-newyorkcity.privateinternetaccess.com 1198
remote us-midwest.privateinternetaccess.com 1198
@Jakobud
Jakobud / up.sh
Created Dec 28, 2017
OpenVPN auto-start Transmission Downloads
View up.sh
#!/bin/sh
echo "Starting Transmission Torrent Downloading"
transmission-remote --auth transmission:transmission --torrent all --start
@Jakobud
Jakobud / down.sh
Last active Dec 28, 2017
OpenVPN auto-stop Transmission downloads
View down.sh
#!/bin/sh
echo "Stopping Transmission Torrent Downloading"
transmission-remote --auth transmission:transmission --torrent all --stop
@Jakobud
Jakobud / _map-sort.scss
Last active Apr 6, 2019
Sort a SASS map
View _map-sort.scss
/// map-sort
/// Sort map by keys
/// @param $map - A SASS map
/// @returns A SASS map sorted by keys
/// @requires function list-sort
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@function map-sort($map) {
$keys: list-sort(map-keys($map));
$sortedMap: ();
@each $key in $keys {
@Jakobud
Jakobud / _list-sort.scss
Last active Sep 27, 2018
Sort a SASS list
View _list-sort.scss
/// list-sort
/// Sort a SASS list
/// @param $list - A SASS list
/// @returns A sorted SASS list
/// @requires function list-remove
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@function list-sort($list) {
$sortedlist: ();
@while length($list) > 0 {
$value: nth($list,1);
@Jakobud
Jakobud / _list-remove.scss
Created Apr 25, 2017
Removed an item for a SASS list based on it's index (mimics behavior of the native map-remove function)
View _list-remove.scss
/// list-remove
/// Remove an item from a list
/// @param $list - A SASS list
/// @param $index - The list index to remove
/// @returns A SASS list
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@function list-remove($list, $index) {
$newList: ();
@for $i from 1 through length($list) {
@if $i != $index {
@Jakobud
Jakobud / _poly-fluid-sizing.scss
Last active Oct 5, 2018
Poly Fluid Sizing using linear equations, viewport units and calc()
View _poly-fluid-sizing.scss
/// poly-fluid-sizing
/// Generate linear interpolated size values through multiple break points
/// @param $property - A string CSS property name
/// @param $map - A SASS map of viewport unit and size value pairs
/// @requires function linear-interpolation
/// @requires function map-sort
/// @example
/// @include poly-fluid-sizing('font-size', (576px: 22px, 768px: 24px, 992px: 34px));
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@mixin poly-fluid-sizing($property, $map) {
@Jakobud
Jakobud / _linear-interpolation.scss
Last active Oct 23, 2018
Linear Interpolation SASS function
View _linear-interpolation.scss
/// linear-interpolation
/// Calculate the definition of a line between two points
/// @param $map - A SASS map of viewport widths and size value pairs
/// @returns A linear equation as a calc() function
/// @example
/// font-size: linear-interpolation((320px: 18px, 768px: 26px));
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@function linear-interpolation($map) {
$keys: map-keys($map);
@if (length($keys) != 2) {
@Jakobud
Jakobud / _leastSquaresFit.scss
Last active Nov 26, 2017
Least Squares Fit Linear Regression SASS function
View _leastSquaresFit.scss
/// leastSquaresFit
/// Calculate the least square fit linear regression of provided values
/// @param {map} $map - A SASS map of viewport width and size value combinations
/// @return Linear equation as a calc() function
/// @example
/// font-size: leastSquaresFit((576: 24, 768: 24, 992: 34));
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@function leastSquaresFit($map) {
// Get the number of provided breakpoints
@Jakobud
Jakobud / removecompletedtorrents.sh
Created Jul 7, 2016 — forked from bulljit/removecompletedtorrents.sh
Transmission-Daemon: Remove Completed Torrents
View removecompletedtorrents.sh
#!/bin/sh
# script to check for complete torrents in transmission folder, then stop and move them
# either hard-code the MOVEDIR variable here…
MOVEDIR=/home/mjdescy/media # the folder to move completed downloads to
# …or set MOVEDIR using the first command-line argument
# MOVEDIR=%1
# use transmission-remote to get torrent list from transmission-remote list
# use sed to delete first / last line of output, and remove leading spaces
# use cut to get first field from each line
You can’t perform that action at this time.