Skip to content

Instantly share code, notes, and snippets.

@hensapir
hensapir / backup-sites.py
Last active May 11, 2016 21:03
script to backup websites and their corresponding MySQL databases to S3
#!/usr/bin/python3
import os
import tarfile
from subprocess import call
from datetime import datetime, timedelta
static_sites = [
"site1.com",
@hensapir
hensapir / redirect-test.py
Last active February 2, 2016 13:28
Apache VirtualHost redirect test -- tests if a web server redirects to all URLs specified in an Apache .conf file
#! /usr/bin/env python2
import re
import sys
import os.path
import requests
def get_all_server_names(vhost_filename):
"""
@hensapir
hensapir / paginated_collection.js
Last active August 29, 2015 14:26 — forked from io41/paginated_collection.js
Pagination with Backbone.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'