Skip to content

Instantly share code, notes, and snippets.

@StudioLE
StudioLE / README.md
Created September 7, 2016 08:58 — forked from danbri/README.md
Schema.org hierarchy Sunburst
@StudioLE
StudioLE / .block
Last active April 15, 2018 07:44 — forked from mbostock/.block
Hive Plot (Links)
license: gpl-3.0
@StudioLE
StudioLE / plex-update.sh
Created February 8, 2016 11:29
Download and install Plex updates
#!/bin/bash
# From: https://forums.plex.tv/discussion/comment/1059738/#Comment_1059738
wget -q -O- https://plex.tv/downloads/1/archive | grep "downloads.plex.tv.*amd64.deb" | head -1 | sed -e "s/.*https/https/" -e "s/amd64.deb.*/amd64.deb/" | xargs wget -q -nc; ls -t *amd64.deb | head -1 | xargs dpkg -i -E
for ($i = 1; $i <= 100; $i++) {
if ($i % 3 == 0) {
echo "Fizz";
}
elseif ($i % 5 == 0) {
echo "Buzz";
}
else {
echo $i;
}
@StudioLE
StudioLE / git-rm-cached.sh
Last active August 29, 2015 14:26
Remove folder from .git but not from local
# http://stackoverflow.com/questions/1947430/git-remove-directory
# Remove from cache
git rm -r -f --cached DIR_NAME
# Then add DIR_NAME to .gitignore
@StudioLE
StudioLE / update.sh
Last active April 3, 2016 10:07
Shell Tools Suite
#!/bin/bash
echo "apt-get update & upgrade wizard"
echo "Would you like to assume yes? [y/n]"
read input_force
if [ $input_force = y ]
then
force="--yes"
fi
@StudioLE
StudioLE / update.sh
Last active August 29, 2015 14:26
Chain apt-get update > upgrade > dist-upgrade > autoremove
#!/bin/bash
echo "apt-get update & upgrade wizard"
echo "Would you like to assume yes? [y/n]"
read input_force
if [ $input_force = y ]
then
force="--yes"
fi
@StudioLE
StudioLE / gist:7201ce9c115771555ef0
Last active December 23, 2016 10:38
Useful Regex
// Condense triple line breaks
//
// Find
/\n\n\n+/
// Replace
\n\n
// Remove EOL whitespace
//
// Find
@StudioLE
StudioLE / app.js
Last active August 29, 2015 14:24
Make AngularJS $http service behave like jQuery.ajax()
// From: http://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/
// Your app's root module...
angular.module('MyModule', [], function($httpProvider) {
// Use x-www-form-urlencoded Content-Type
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
/**
* The workhorse; converts an object to x-www-form-urlencoded serialization.
* @param {Object} obj
@StudioLE
StudioLE / gist:e6c254f02aa8d145562f
Created April 4, 2015 14:57
Hide changes to files in git but preserve the original file in the repository
# To hide future changes
git update-index --assume-unchanged filepath
# To unhide changes
git update-index --no-assume-unchanged filepath