Skip to content

Instantly share code, notes, and snippets.

@rodelrod
rodelrod / geot-redirects.php
Created October 15, 2016 16:44 — forked from timersys/geot-redirects.php
Geotargeting redirects
<?php
/**
* Create Custom Redirects from home page only
* @link http://wp.timersys.com/geotargeting/
*
* @wordpress-plugin
* Plugin Name: GeoTargeting Pro Custom Redirects
* Plugin URI: http://wp.timersys.com/geotargeting/
* Description: Geo Targeting custom redirects
* Version: 1.0.0
@rodelrod
rodelrod / tmux.conf
Last active December 16, 2016 18:41 — forked from shinzui/tmux.conf
tmux.conf
# ~/.tmux.conf
#
# Forked from: https://gist.github.com/shinzui/866897
#
# Set prefix key to Ctrl-a
unbind-key C-b
set-option -g prefix C-a
# send the prefix to client inside window
@rodelrod
rodelrod / retry.py
Created September 24, 2015 13:44
Retry: Invokes repeatedly function calls that may raise an exception, until they don't
import time
def retry(f, tries, exc, pause=0, *args, **kwargs):
"""Repeats function n times until it succeeds or we give up.
Use case: `f` invokes an API that may fail or be unavailable. We assume
`f` raises an exception when something goes wrong. We can use this
function to invoke `f` multiple times until an exception is not raised.
Args: