Skip to content

Instantly share code, notes, and snippets.

View LoveIsGrief's full-sized avatar

LoveIsGrief

View GitHub Profile
@LoveIsGrief
LoveIsGrief / guest_additions.bash
Created June 14, 2015 22:10
Simple script to install guest additions on a linux, virtualbox guest. Pretty unsophisticated so far
#!/bin/bash
# Simple script to install guest additions on a linux, virtualbox guest.
# Pretty unsophisticated so far
# Adapted from https://docs.vagrantup.com/v2/virtualbox/boxes.html
# Virtualbox version
version=4.3.28
if [ -n "$1" ]; then
version=$1
fi
@LoveIsGrief
LoveIsGrief / .gitignore
Last active June 28, 2019 13:40
For people who use Reddit, the anonymous nature of the web site lends itself to people utilizing multiple accounts. The following script can be used to copy all subreddit subscriptions and friends from a source to a destination account. Note that this script requires a specific revision of the praw API in order to copy over friends lists due to …
# Created by .ignore support plugin (hsz.mobi)
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
@LoveIsGrief
LoveIsGrief / grease_private_tabs.user.js
Last active February 24, 2016 12:05
A GreaseMonkey script used in conjuncation with FF Private Tabs to open certain links in private tabs
// ==UserScript==
// @name Private tabs for certain links
// @description Opens certain links in a private FF tab. Requires https://addons.mozilla.org/fr/firefox/addon/private-tab/?src=api
// @namespace http://userscripts.org/users/399688
// @include /https?:\/\/(np\.|www\.)reddit.com\/.*/
// @version 1.1.1
// @grant GM_openInTab
// ==/UserScript==
/*
Changelog:
@LoveIsGrief
LoveIsGrief / soundcloudsEndScroll.js
Created August 7, 2016 22:13
Scrolls to the end of the soundcloud likes pages in order to help randomizing by all your tracks
/**
Script for soundclound that still hasn't implemented randomized playing of favorite tracks.
This will just continuously scroll to the end of the page when the button is hit and stop when hit again.
Yeah, the CSS sucks giant, monsterballs and it works like shit. So fucking what. It kinda, sorta works.
Made in Firefox's Ardoise.
TODO Monkeyscript this shit
@LoveIsGrief
LoveIsGrief / soundcloudsEndScroll.user.js
Created September 4, 2016 12:39
Monkeyscript to scroll to the end of the likes, because soundclound doesn't allow random sort of the whole collection
// ==UserScript==
// @name Soundcloud scroll
// @namespace http://userscripts.org/users/399688
// @description Scroll to the end of the likes, because soundclound doesn't allow random sort of the whole collection
// @include https://soundcloud.com/*
// @version 1
// @grant none
// ==/UserScript==
/**
import java.text.SimpleDateFormat;
import java.util.*;
public class LocalesList {
static public void main(String[] args) {
Locale list[] = SimpleDateFormat.getAvailableLocales();
Set set = new TreeSet();
Set englishSet = new TreeSet();
@LoveIsGrief
LoveIsGrief / firefox-nightly.bash
Created March 29, 2017 08:14
The beginnings of a script to keep firefox-nightly up to date using cron. (Maybe not necessary if firefox nightly does that itself)
#!/usr/bin/env bash
# Unofficial bash strict mode http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
url="https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=en-US"
dir=~/programs/firefox/nightly
version=`curl -s "${url}" | sed -E 's/.*firefox-(.*)\.linux.*/\1/g'`
versionDir="${dir}/${version}"
@LoveIsGrief
LoveIsGrief / in2outerr.py
Created July 22, 2017 11:03
Script to copy stdin to stdout and stderr since it's not easily possible in bash
#!/usr/bin/python3 -u
"""
Script to copy stdin to stdout and stderr since it's not easily possible in bash
Example usage:
# This will download a page and discard it (but it could be saved)
# and pipe the progress for further processing
# It'll still be visible thanks to in2outerr.py
# but tr will still be able to process it
@LoveIsGrief
LoveIsGrief / phrases.txt
Created September 27, 2017 22:21
Short phrases for voices.mozilla.com
I grew strong from the pain I was dealt.
The anisotropic filter was bogging down the rendering process.
Cheese has many uses, but is considered a condiment by some.
In a fit of rage, the chair flew through the French window.
His life changed after the accident and he hasn't slept since.
@LoveIsGrief
LoveIsGrief / hideUninterestingRedditPosts.user.js
Created October 16, 2017 07:20
Hides posts you keep seeing, but never click or vote on
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/**
* How many times we should try and hide this shit...
*/
const MAX_HIDE_ATTEMPTS = 3;
/**
* How long to wait before checking if something has been hidden
* In milliseconds
*/