Skip to content

Instantly share code, notes, and snippets.

fopina / outlook-push.vba
Last active August 29, 2015 14:02
Outlook VBA Script to push new mail notifications using
' Small Outlook-VBA script to push a new email notification to your iOS device
' using QPush (
' Just install the application on your iOS device, choose a Push Name
' and place that and the generated Push Code in the section below
' How to add the script to Outlook?
' - Press Alt-F11 in Outlook to open Builtin VBA Editor
' - Paste this code in "ThisOutlookSession", save and exit edtior
' - Create a rule with the action "run script" and select the saved script
fopina /
Created April 1, 2015 13:45
Python script to push list of repositories to Gitlab
I wanted to migrate all my gitosis repositories to
Compile a list with the repositories in text file and run this script with your GITLAB token, the name of the text file and a directory to be used to clone the repositories temporarily.
python x1xxxxxxxxxxX1Xx1xXX repos.txt /tmp/
fopina /
Created April 1, 2015 18:28
Python script to copy redmine issues to gitlab
Requires python-redmine and gitlab3 (both available with pip)
Copy all issues from a Redmine server to Gitlab for the projects specified in a text mapping the projects such as:
from redmine import Redmine
fopina /
Created August 7, 2015 10:32
get_or_create() versus try: .create() in peewee+pgsql
#!/usr/bin/env python
Sometimes we need to use a model in peewee that we want to get from DB or create if it doesn't exist.
We have get_or_create and create_or_get for that.
But what if it don't really want the instance of the model? We simply want to create it (for logging purposes maybe)?
Is there a faster method than these two, assuming we will be inserting a lot of duplicate records?
I usually simply do:
fopina / magnet-transmission.user.js
Created March 7, 2012 16:22
Magnets2Transmission userscript
// ==UserScript==
// @name Magnet-Transmission
// @namespace
// @description PirateBay + Transmission
// @include*
// @include*
// ==/UserScript==
unsafeWindow.sendToTransmission = function(href) {
fopina /
Last active March 13, 2016 20:15
flask versus Django request times (without tweaking)
set -e
DIR=$(mktemp -d)
function setup_venv() {
cd $DIR
virtualenv env
. env/bin/activate
fopina /
Last active April 4, 2016 14:40
simplified script to compare pafy searches (in mopidy-youtube) across systems
- pip install requests pafy youtube-dl
import pafy
import requests
import string
import unicodedata
import re
from multiprocessing.pool import ThreadPool
fopina /
Created June 23, 2015 16:35 Bulk AddToHistory
from urllib2 import Request, urlopen
import json
import sys
URL = ''
# create your own app
API_KEY = ''
PIN_URL = ''
fopina /
Created July 23, 2015 17:00
sqlite3 vs unqlite
#!/usr/bin/env python
pip install pysqlite
pip install unqlite
import sqlite3
from unqlite import UnQLite
import timeit
fopina /
Created December 18, 2015 15:07
Python function to push messages using
import urllib2
import urllib
def qpushit(name, code, message):
data = urllib.urlencode({
'name': name,
'code': code,
'sig': '',
'cache': False,