Skip to content

Instantly share code, notes, and snippets.

View michaelmrose's full-sized avatar
💭
Available to hire

Michael Rose michaelmrose

💭
Available to hire
View GitHub Profile
@michaelmrose
michaelmrose / example.fish
Created June 28, 2015 23:49
default variables and variable parsing in fish
set somevariable default val
set someothervariable default val
for i in (getvariables $argv)
set val (explode $i)
set $val[1] $val[2]
end
function getvariables
if not substr "$argv" =
@michaelmrose
michaelmrose / keyhandler and fishstdin
Created July 12, 2015 06:12
Enable Custom Actions in SXIV
#!/bin/sh
# Example for $XDG_CONFIG_HOME/sxiv/exec/key-handler
# Called by sxiv(1) after the external prefix key (C-x by default) is pressed.
# The next key combo is passed as its first argument. The paths of all marked
# images--or of the current image, if no image is marked--are passed via stdin,
# one file path per line.
# sxiv(1) blocks until this script terminates. It then checks which images
# have been modified and reloads them.
@michaelmrose
michaelmrose / mpv-0.9.2.ebuild
Created July 17, 2015 19:25
Working ebuild for latest mpv as of 7-16-15
# Distributed under the terms of the GNU General Public License v2
EAPI=5
EGIT_REPO_URI="https://github.com/mpv-player/mpv.git"
PYTHON_COMPAT=( python{2_7,3_3,3_4} )
PYTHON_REQ_USE='threads(+)'
inherit eutils python-any-r1 waf-utils pax-utils fdo-mime gnome2-utils
[[ ${PV} == *9999* ]] && inherit git-r3
@michaelmrose
michaelmrose / colors.conf
Created September 12, 2015 01:42
colors.conf for hexchat
color_0 = ffff ffff ffff
color_1 = 4e4e 4e4e 4e4e
color_2 = a8a8 ffff 6060
color_3 = ffff 7373 fdfd
color_4 = 9696 cbcb fefe
color_5 = 7777 5454 3e3e
color_6 = 94bc 5925 ffff
color_7 = eaea 9595 1f1f
color_8 = ffff ffff b6b6
color_9 = a6a6 e2e2 2e2e
@michaelmrose
michaelmrose / zathu
Created September 12, 2015 01:45
zathura config
# Zathura configuration file
# See man `man zathurarc'
# Open document in fit-width mode by default
set adjust-open "best-fit"
# One page per row by default
set pages-per-row 1
#stop at page boundries
@michaelmrose
michaelmrose / compton.conf
Created October 2, 2015 21:20
transparent windows i3-bar and i3 frames
opacity-rule = [
"93:class_g = 'URxvt' && !_NET_WM_STATE@:32a",
"90:class_g = 'Qvim' && !_NET_WM_STATE@:32a",
"95:class_g = 'Zathura' && !_NET_WM_STATE@:32a",
"95:class_g = 'Spacefm' && !_NET_WM_STATE@:32a",
"88:class_g = 'LilyTerm' && !_NET_WM_STATE@:32a",
"80:class_g = 'i3-bar' && !_NET_WM_STATE@:32a",
"50:class_g = 'i3-frame' && !_NET_WM_STATE@:32a",
"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];
@-moz-document domain("www.freecodecamp.com") {
body {background: #0c0c0c;}
.navbar {background: #111;}
.navbar-right{background: #111;}
.panel-heading{
background: #111 !important;
border-color:#111 !important;
}
.panel-info{border-color:#111;}
.panel-body{background-color:#222}
@michaelmrose
michaelmrose / romanity.js
Last active January 17, 2016 08:41
oh the romanity
function convert(num) {
var remainder = num;
var result = "";
while(remainder > 0){
var number = closestNumeralWithoutGoingOver(remainder);
result = result.concat(returnNumeral(number));
remainder -= number;
}
return result;
}
function romanMain() {
this.version = '0.81';
w = 420;
h = 60;
var s = "";
s += '<div style="position:relative; width:' + w + 'px; height:' + h + 'px; background-color: #def; border: 2px solid #ddeeff; border-radius: 10px; margin:auto; display:block;">';
s += '<div style="margin-top: 10px; font: 16px arial; font-weight: bold; color: black; text-align:center;">';
s += '<input id="val" size="26" style="font-size: 20px; line-height: 26px; text-align:center;" />';
s += '<input type="submit" value="Convert" style="font-size: 18px; line-height: 24px" onclick ="get()" />';
s += '</div>';
@michaelmrose
michaelmrose / recursiveRomanity.js
Created January 18, 2016 15:47
recursive solution to roman numeral generator
var numerals = [1,4,5,9,10,40,50,90,100,400,500,900,1000];
var ohtheromanity = {1: "I", 4: "IV", 5:"V", 9: "IX", 10: "X", 40: "XL", 50: "L",
90: "XC", 100: "C", 400: "CD", 500: "D", 900: "CM", 1000: "M"};
function convert(n) {
if (n === 0){return "";}
else {
var largestInclusiveNumber = numerals.sort(function(x,y){return x-y;}).filter(function(x){return x<=n;}).pop();
var remainder = n -= largestInclusiveNumber;
return ohtheromanity[largestInclusiveNumber].concat(convert(remainder));
}