Skip to content

Instantly share code, notes, and snippets.

View elboletaire's full-sized avatar
🍄
hunting mushrooms

Òscar Casajuana elboletaire

🍄
hunting mushrooms
View GitHub Profile
@elboletaire
elboletaire / workshop-download-button.js
Created August 10, 2020 00:21
Steam Workshop download button User Script
// ==UserScript==
// @name Steam Workshop Downloader
// @version 0.1
// @description Downloads steam workshop items using steamworkshopdownloader api
// @author El Boletaire
// @include *steamcommunity.com/sharedfiles/filedetails/?*id=*
// @include *steamcommunity.com/workshop/filedetails/?*id=*
// @grant GM_xmlhttpRequest
// @namespace https://github.com/elboletaire
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am elboletaire on github.
  • I am elboletaire (https://keybase.io/elboletaire) on keybase.
  • I have a public key ASBiljF-WDRtuJVz19IBjPiY8_XHfLl1ZdK3CM1eggjZcwo

To claim this, I am signing this object:

@elboletaire
elboletaire / description.md
Created April 2, 2015 10:44
Git hook prepare-commit-msg

This git hook extracts the number from a branch and adds it to the commit message as refs. i.e.:

From a branch named whatever-branch-name-5234 will create a commit message like this:

refs #5234
# git COMMIT_MSG comments
@elboletaire
elboletaire / gmail-replace.js
Last active September 19, 2015 23:36
Removes the gmail caching prefix for images, leaving just the real images.
var images = document.getElementsByTagName('img');
for (var i in images) {
if (typeof images[i] !== 'object' || typeof images[i].src === 'undefined') continue;
if (/([^#]+)#(https?.+)/.test(images[i].src)) {
var matches = images[i].src.match(/([^#]+)#(https?.+)/);
images[i].src = matches[2];
}
}
@elboletaire
elboletaire / mapmanager.js
Created May 29, 2014 15:54
A helper for google maps V3
/**
* MapManager helper class for google maps api V3
*
* @author Òscar Casajuana <elboletaire@underave.net>
* @param {object} options Default options to pass to the map manager
* {
* id: "map", // your canvas id
* multiple_select: true, // set to true to show a multiple select when there are multiple results
* max_points: 23, // max number of points allowed into the map (false to disable)
* limit_alert: "You reached the limit!", // The alert showed when trying to add more points than allowed
@elboletaire
elboletaire / get-gitignore.sh
Last active March 13, 2019 21:54
A bash method to get gitignore files from github gitignore's repo
get_gitignore() {
local gitignore=https://raw.github.com/github/gitignore/master/$1.gitignore
local exists=`curl -s --head -w %{http_code} $gitignore -o /dev/null`
if [[ $exists -eq 404 ]]; then
echo "El gitignore esmentat no existeix. Comprova que l'has escrit be"
else
curl -s https://raw.githubusercontent.com/github/gitignore/master/$1.gitignore
fi
}
@elboletaire
elboletaire / powershell_here.reg
Created September 7, 2013 04:04
Open powershell here
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\powershell]
"Icon"="%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
@="Obre powershell"
[HKEY_CLASSES_ROOT\Directory\shell\powershell\command]
@="C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe -NoExit -NoLogo -Command Set-Location -LiteralPath '%L'"
[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell]
@elboletaire
elboletaire / unicorn.sh
Created May 13, 2013 19:54
Unicorn init.d script
#!/bin/bash
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by elboletaire@underave.net http://github.com/elboletaire
# based on https://gist.github.com/jaygooby/504875 http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
@elboletaire
elboletaire / spam-boxes.php
Last active March 13, 2019 21:57
Email spam box services array
<?php
$spam_boxes = array(
'mailinator\.com',
'6url\.com',
'dodgeit\.com',
'greensloth\.com',
'spam\.la',
'spamday\.com',
'tempinbox\.com',
@elboletaire
elboletaire / gist:5190367
Last active October 22, 2020 07:21
Switch Domain Bookmarklet
var dev = 'http://underave.loc';
var prod = 'https://underave.net';
var redirect = location.origin == dev ? prod : location.origin == prod ? dev : false;
if (redirect) {
location.href = redirect + location.pathname + location.search + location.hash;
}
// Compressed just for adding it to your bookmarks toolbar: