Skip to content

Instantly share code, notes, and snippets.

@tzengerink
tzengerink / gist:2959003
Created June 20, 2012 09:21
Automated MySQL Dump
#!/bin/bash
#
# MYSQL BACKUP
# ------------
# Usage: Setup a cronjob to execute the script and your done.
#
# Copyright (c) 2012, T. Zengerink
# Licensed under MIT License.
# See: https://raw.github.com/gist/3151357/9e8e01df4ee12b1f04cd61e0ecee3ea8bd6f617b/mit-license.txt
@tzengerink
tzengerink / gist:2973651
Created June 22, 2012 15:54
Uptime Monitor
#!/bin/bash
#
# UPTIME MONITOR
# --------------
# Usage: Setup a cronjob to execute the script and your done.
#
# Copyright (c) 2012, T. Zengerink
# Licensed under MIT License.
# See: https://raw.github.com/gist/3151357/9e8e01df4ee12b1f04cd61e0ecee3ea8bd6f617b/mit-license.txt
@tzengerink
tzengerink / flask_geventwebsocket_example.py
Created June 22, 2012 20:15 — forked from lrvick/flask_geventwebsocket_example.py
Simple Websocket echo client/server with Flask and gevent / gevent-websocket
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@tzengerink
tzengerink / LICENSE.md
Last active October 7, 2015 10:28
MIT License

Copyright (c) 2014 Teun Zengerink

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@tzengerink
tzengerink / pubsub.js
Last active October 7, 2015 10:37
PubSub.js
/*!
* PubSub.js
* ---------
*
* Extremely basic PubSub functionality.
*
* To subscribe to the topic `news`:
*
* PubSub.on("news", function(str){
* alert(str);
@tzengerink
tzengerink / edit-protection.js
Last active October 7, 2015 14:57
JavaScript Edit Protection
/*!
* EditProtection.js
* -----------------
*
* Small module that provides protection against clicking a link while information stored in form input
* fields is not yet saved on the server.
*
* To enable edit protection, use:
*
* $(document).ready(function(){
@tzengerink
tzengerink / i18n.js
Last active October 11, 2015 03:08
I18N.js
/*!
* I18N.js
* -------
*
* Add internationalisation to your JavaScript application.
*
* // Get current language
* I18N.lang(); // en
*
* // Set current language
@tzengerink
tzengerink / desire.js
Last active March 1, 2018 15:04
Desire.js
/*!
* Desire.js
* ---------
*
* Create the namespaces you so desire.
*
* // Create a new module
* desire("APP.MyModule.MySubModule", function(){
* return {
* myProp : "Your property value",
@tzengerink
tzengerink / google-search.py
Last active May 22, 2024 11:08
Google Search
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
GOOGLE SEARCH
-------------
Command line access to advanced Google searches.
To see all options use the `--help` flag.
Copyright (c) 2013, T. Zengerink
Licensed under MIT License
@tzengerink
tzengerink / database-modifications-table.sql
Last active October 11, 2015 08:48
Database Modifications Table
/* DATABASE MODIFICATIONS TABLE
* ----------------------------
*
* Create a database modifications table to keep track of all changes made to
* the structure of a database.
*
* At the bottom of all your scripts that modify the structure, you put a line
* like:
*
* INSERT INTO `database_modifications` (`id`, `script_name`, `comments`)