Skip to content

Instantly share code, notes, and snippets.

View pblocz's full-sized avatar

Pablo Cabeza García pblocz

  • Elastacloud
  • London
View GitHub Profile
@pblocz
pblocz / update-owlbear-map.py
Created June 21, 2022 21:15
Update owlbear exported map. Old is the map with the notes, tokens, etc and New is the map with the updated background.
#%%
from dataclasses import InitVar, dataclass, field
import json
from pathlib import Path
from typing import Any, Dict
import jmespath as jm
#%%
old = Path("old.owlbear")
VS Code extensions
'''
There are 2 types of functions normal `def func()` and `async def func()`:
- An asyc function can call async functions as well as normal ones
- A normal function can only call normal functions
'''
#%%
import asyncio
import datetime
// ==UserScript==
// @name Open week view in zoho
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://people.zoho.com/*/zp
// @require https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js
// @grant unsafeWindow
// ==/UserScript==
@pblocz
pblocz / redirect-microsoft
Created January 21, 2019 17:17
Redirect to english Microsoft docs
// ==UserScript==
// @name redict-microsoft
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Redirect to english Microsoft docs
// @author Pablo Cabeza Garcia
// @match https://*.microsoft.com/*
// @grant none
// ==/UserScript==
import functools
import click
class Command:
def __init__(self, f, args, kwargs):
self.f = f
self.args = args
self.kwargs = kwargs
self.cmd = click.command(*args, **kwargs)(f)
@pblocz
pblocz / .vimrc
Last active October 17, 2017 22:08
"
" 0. configure proxy:
" git config --global http.proxy http://proxyuser:[email protected]:8080
" 1. Download and install vim-plug
"
" 2. Do a :PlugInstall
"
" 3. If command-t not working try `rake make` from its folder
" if not in path, install it with
" export HTTP_PROXY=<proxy>; gem install --local rake
@pblocz
pblocz / banshee-beets-sync.py
Last active March 6, 2017 03:01
script that updates track ratings in banshee database from beet favorite songs
#! /usr/bin/env python
'''
Script that syncs beet favorites with banshee.
'''
import click
from beets import library
import os
@pblocz
pblocz / audacious-sync.py
Last active March 6, 2017 03:03
Script that syncs a playlist (m3u) with current audacious playlist.
#! /usr/bin/env python
'''
Script that syncs a playlist (m3u) with current audacious playlist.
'''
import click
import os
import shlex
import subprocess as sp
@pblocz
pblocz / canto-curses-notify-plugin.py
Last active June 18, 2016 13:31
canto-curses notification plugin
'''
canto-curses-notify v0.3 | Copyright (c) 2015, Pablo Cabeza
MIT Licese (http://opensource.org/licenses/mit-license.php)
Notification plugin for
[canto-curses](https://github.com/themoken/canto-curses) that
integrates with desktop notifications. See [Canto
webpage](http://codezen.org/canto-ng/) for more info.