Skip to content

Instantly share code, notes, and snippets.

View unRARed's full-sized avatar

Ryan Richardson unRARed

View GitHub Profile
@unRARed
unRARed / wav-trigger.sh
Created March 20, 2024 08:15
Make wav files compatible with the Spark Wav Trigger board
mkdir fixed
# WAV Files need to be Stereo, 44100, 16bit and have no metadata
for file in *.wav; do ffmpeg -y -i $file -ac 2 -ar 44100 -sample_fmt s16 -map_metadata -1 -fflags +bitexact -flags:v +bitexact -flags:a +bitexact fixed/$file; done
@unRARed
unRARed / new-billboard.js
Created August 15, 2021 18:56
Only "New" songs in Billboard Top-100 (Bookmarklet)
javascript: (function() {
var showNew = function () {
$('.chart-element__trend:not(.chart-element__trend--new)').
closest('.chart-list__element').remove();
$('.chart-list__ad').remove();
$('.chart-list__element').each(function () {
if ($(this).find('.chart-element__trend').text() === 'Re-Enter') {
$(this).remove();
return;
}
0xCEBD0f28178330F5b31ff0b3cb0293C8e42763A3
@unRARed
unRARed / slack_delete.rb
Created May 17, 2018 16:44 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@unRARed
unRARed / random-fixes-and-things.md
Last active April 26, 2017 02:09
Random things I've wasted hours of my life Googling

Debian jessie auto-login user

Totally stolen from elsewhere, but worked for me...

  • Edit file /etc/systemd/system/getty.target.wants/getty@tty1.service
  • Find the [Service] section and change ExecStart line to read
  • ExecStart=-/sbin/agetty --noclear -a YOUR_USERNAME_HERE %I 38400
@unRARed
unRARed / capture.bat
Created January 6, 2017 05:51
Capture from my 2 webcams simultaneously (work in progress)
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-3 delims=/:/ " %%a in ('time /t') do (set mytime=%%a-%%b-%%c)
start VirtualDub.exe /capture /capdevice c525 /capfile "C:\Users\unrared\Storage\Video\VirtualDub\%mydate%_%mytime%_c525.avi" /priority realtime /capstart
start VirtualDub.exe /capture /capdevice c920 /capfile "C:\Users\unrared\Storage\Video\VirtualDub\%mydate%_%mytime%_c920.avi" /priority realtime /capstart
@unRARed
unRARed / elixirphoenix.bash
Created January 3, 2017 00:54 — forked from likethesky/elixirphoenix.bash
Installing Elixir & the Phoenix framework with Homebrew on OS X
$ brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered!
$ brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it.
$ brew install elixir
$ mix local.hex # Answer y to any Qs
$ createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw...
# Use the latest Phoenix from here: http://www.phoenixframework.org/docs/installation -- currently this is 1.0.3
# ** Answer y to any Qs **
$ mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.0.3/phoenix_new-1.0.3.ez
@unRARed
unRARed / bamboo
Created December 19, 2016 22:03
Modified Bamboo Startup script for Debian/Ubuntu
#!/bin/sh
# For Atlassian Bamboo version 5.14.3.1+
# The script here was out of date:
# https://confluence.atlassian.com/bamboo/running-bamboo-as-a-linux-service-416056046.html
set -e
### BEGIN INIT INFO
# Provides: bamboo
@unRARed
unRARed / placehold-404.php
Last active November 4, 2015 21:31 — forked from CurtisL/placehold-404.php
Wordpress filter to replace 404'd images with a placeholder, Good for when you're working locally but don't want to copy down the whole uploads directory.
<?php
/**
* Dev Helper for 404'd Images
*/
function placehold_404( $image ) {
if ( !file_exists( str_replace(get_home_url().'/', '', $image[0]) ) ) {
// Replace the image source with a placeholder at the proper dimensions.
$image[0] = "http://placehold.it/{$image[1]}x{$image[2]}/ffd602/000000";
}
return $image;
@unRARed
unRARed / gist:08a392a7d637b722ef24
Created February 3, 2015 07:28
Bash alias for keeping master branch in sync with upstream repository to better prevent conflicts.
alias sync_master='WORKING_BRANCH="$(git rev-parse --abbrev-ref HEAD)" && git checkout master && git fetch upstream master && git reset --hard upstream/master && git checkout $WORKING_BRANCH'