Skip to content

Instantly share code, notes, and snippets.

@cwill747
cwill747 / twitch_vod_seasons.sh
Created January 17, 2018 22:04
Downloads a Twitch Vod for Plex Tv Shows
#!/usr/bin/env bash
JSON="$(youtube-dl -j $1)"
UPLOADER=$(echo "${JSON}" | jq -c -r '.uploader')
UPLOAD_DATE=$(echo "${JSON}" | jq -cr '.upload_date')
TITLE=$(echo "${JSON}" | jq -cr '.title')
EXTENSION=$(echo "${JSON}" | jq -cr '.ext')
UPLOAD_YEAR=${UPLOAD_DATE:0:4}
BASE_FOLDER="${UPLOADER}/${UPLOAD_YEAR}"
VIDEO_COUNT=$(ls -l "${BASE_FOLDER}" | wc -l)
@cwill747
cwill747 / Dockerfile
Last active April 20, 2022 12:47
Python2.6 on Alpine Docker
FROM gliderlabs/alpine:3.4
# ensure local python is preferred over distribution python
ENV PATH /usr/local/bin:$PATH
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# install ca-certificates so that HTTPS works consistently
@cwill747
cwill747 / reclaimWindows10.ps1
Last active January 9, 2017 17:56 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
@cwill747
cwill747 / ksdiff_rtc.sh
Created March 7, 2016 19:25
Kaleidoscope Diff for Rational Team Concert (RTC)
#!/bin/bash
filename=$(basename $3)
cp $3 /tmp/$filename
/usr/local/bin/ksdiff --merge --wait --output $1 --base $2 -- /tmp/$filename $4 --snapshot
rc=$?
exit $rc
--Battery Widget
batt = wibox.widget.textbox()
function get_batterystatus()
local filedescriptor = io.popen("/<location-to-script>/<whatever-you-called-it>.sh")
local value = filedescriptor:read()
filedescriptor:close()
return {value}
end
vicious.register(batt, get_batterystatus, '$1', 10)
span_hi='<span color="#ff8700">' #colour for normal battery
span_lo='<span color="#aaaaaa">' #colour for normal battery
span_sep='<span color="#ff8700">' #colour for normal battery
span_warn='<span color="#ff0000">'
## Set battery message
batt=`cat /sys/devices/platform/smapi/BAT0/remaining_percent`
if (($batt <= 30));
then battstate=$span_warn$batt'%% </span>'$span_lo`cat /sys/devices/platform/smapi/BAT0/state`'</span>'
else battstate=$span_hi$batt'%% </span>'$span_lo`cat /sys/devices/platform/smapi/BAT0/state`'</span>'
@cwill747
cwill747 / index.js
Created December 3, 2015 04:57
requirebin sketch
var console = require('demo-console');
var p1 = "((((()(()(((((((()))(((()((((()())(())()(((()((((((()((()(()(((()(()((())))()((()()())))))))))()((((((())((()))(((((()(((((((((()()))((()(())()((())((()(()))((()))()))()(((((()(((()()))()())((()((((())()())()((((())()(()(()(((()(())(()(())(((((((())()()(((())(()(()(()(())))(()((((())((()))(((()(()()(((((()()(()(((()(((((())()))()((()(()))()((()((((())((((())(()(((())()()(()()()()()(())((((())((())(()()))()((((())))((((()())()((((())((()())((())(())(((((()((((()(((()((((())(()(((()()))()))((((((()((())()())))(((()(()))(()()(()(((()(()))((()()()())((()()()(((())())()())())())((()))(()(()))(((((()(()(())((()(())(())()((((()())()))((((())(())((())())((((()(((())(())((()()((((()((((((()(())()()(()(()()((((()))(())()())()))(())))(())))())()()(())(()))()((()(()(())()()))(()())))))(()))(()()))(())(((((()(()(()()((())()())))))((())())((())(()(())((()))(())(((()((((((((()()()(()))()()(((()))()((()()(())(())())()(()(())))(((((()(())(())(()))))())()))(()))()(()(((((((()((
@cwill747
cwill747 / javascript_resources.md
Last active August 29, 2015 14:19 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@cwill747
cwill747 / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cwill747
cwill747 / coffeescript_to_javascript_destructive.sh
Created March 10, 2015 21:34
Compile Coffeescript to Javascript and delete original javascript - WARNING DESTRUCTIVE - have a backup
find . -name '*.coffee' | while read i; do coffee -b -c "$i" > "${i%.*}.js" && rm "$i"; done