Skip to content

Instantly share code, notes, and snippets.

@rodelrod
rodelrod / geot-redirects.php
Created Oct 15, 2016 — forked from timersys/geot-redirects.php
Geotargeting redirects
View geot-redirects.php
<?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 Dec 16, 2016 — forked from shinzui/tmux.conf
tmux.conf
View 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 Sep 24, 2015
Retry: Invokes repeatedly function calls that may raise an exception, until they don't
View retry.py
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: