Skip to content

Instantly share code, notes, and snippets.

View elegos's full-sized avatar

Giacomo "Mr. Wolf" Furlan elegos

View GitHub Profile
@elegos
elegos / spotify-mpris-art-fix.py
Last active August 28, 2021 00:53
Spotify Linux mpris:artUrl patcher
#!/usr/bin/env python3
# Spotify Linux mpris:artUrl patcher
# by Giacomo Furlan
# spotify-mpris-art-fix.py
import argparse
import os
import re
import shutil
@elegos
elegos / install.sh
Last active October 24, 2020 01:33
Slimbook KDE 2020 touchpad enable/disable on Fedora (KDE Plasma + xbindkeys)
#!/usr/bin/env bash
# Ensure xbindkeys is installed
whichXbindkeys=$(which xbindkeys 2>/dev/null)
if [ "${whichXbindkeys}" == "" ]; then
sudo dnf install xbindkeys
fi
# Create the xbindkeys auto-start symlink
if ! [ -f ~/.config/autostart-scripts/xbindkeys ]; then
@elegos
elegos / atom-packages.sh
Created July 24, 2017 11:05
Atom packages install
#!/usr/bin/env bash
# Packages
apm install \
autoclose-html \
autocomplete-modules \
busy-signal \
ctrl-dir-scroll \
file-icons \
goto-definition \
@elegos
elegos / install-rainbow-bash.sh
Created May 6, 2017 21:48
Rainbow bash install script
#!/usr/bin/env bash
FONTAWESOME_DOWNLOAD_URL="https://github.com/FortAwesome/Font-Awesome/archive/v4.7.0.zip"
POWERLINE_DOWNLOAD_URL="https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf"
TMP=`mktemp -d`
cd $TMP
mkdir -p ~/.fonts
@elegos
elegos / ko.updateModel
Last active August 29, 2015 14:12
Allows a knockout model to be updated with fresh data composed by an object with the same structure as the viewmodel
ko.updateModel = (model, data, path, callback) ->
isObject = (obj) ->
typeof obj is 'object' and !Array.isArray obj
return if not isObject data
callbackIsFunction = (typeof callback) is 'function'
for k, v of data
branchPath = path + "." + k
@elegos
elegos / footer.php
Created June 4, 2013 11:48
Add support for highlight.js in AnchorCMS (any markdown software without the possibility to add classes to <code> tag)! Usage: the first line of a code block must start and contain three colons and the language name AND NOTHING ELSE, for example :::php
@elegos
elegos / mogit.php
Created August 16, 2012 17:35
World of Warcraft MogIt addon's link functions Lua -> PHP
<?php
class MogIt {
private $charset;
private $base;
private $maxlen;
function __construct($charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", $maxlen = 3)
{
$this->charset = $charset;
$this->base = strlen($charset);
@elegos
elegos / h5bp-bootstrap.sh
Created May 8, 2012 18:38
h5bp + twitter bootstrap integration (no npm required)
#!/bin/bash
function echoStep {
echo -e "\n\t$1\n"
}
type lessc >/dev/null 2>&1 || { echoStep "I require lessc but it's not installed or it's not in PATH. Please install it before continuing."; exit; }
lessc=$(which lessc)