This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Delay before starting | |
DELAY=10 | |
# Sound notification to let one know when recording is about to start (and ends) | |
beep() { | |
paplay /usr/share/sounds/freedesktop/stereo/bell.oga & | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func newtonSqrtFormula(z float64, x float64) float64 { | |
return (z - (((z * z) - x) / (2 * z))) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"code.google.com/p/go-tour/pic" | |
"image" | |
"image/color" | |
"math" | |
) | |
type Image struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spatialite views voorbeelden | |
# zie ook: http://www.gaia-gis.it/gaia-sins/spatialite-cookbook/html/sp-view.html | |
########################## | |
### sewerage_pipe_view ### | |
########################## | |
CREATE VIEW sewerage_pipe_view AS | |
SELECT c.ROWID AS ROWID, | |
c.id AS id, | |
c.display_name AS display_name, | |
c.sewerage_type AS sewerage_type, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code from my dotGo.eu 2014 presentation | |
// | |
// Copyright (c) 2014 John Graham-Cumming | |
// | |
// Implement a factory and a task. Call run() on your factory. | |
package main | |
import ( | |
"bufio" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# chkconfig: 2345 55 25 | |
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx | |
# For Debian, run: update-rc.d -f nginx defaults | |
# For CentOS, run: chkconfig --add nginx | |
# | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import subprocess | |
class Pager(object): | |
"""enable paging for multiple writes""" | |
def __init__(self): | |
self.proc = None | |
if hasattr(sys.stdout, 'isatty') and sys.stdout.isatty(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import with_statement # needed for python 2.5 | |
from fabric.api import * | |
from fabric.contrib.console import confirm | |
# ================================================================ | |
# NOTE: | |
# using this fabfile expects that you have the python utility | |
# fabric installed locally, ssh access to reamea.com, and your | |
# ssh public key associated with the account 'mboza@reamea.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 - | |
import os | |
os.environ['TRAC_ENV'] = '/Users/jsmits/.virtualenvs/trac/projects/mysite' | |
os.environ['PYTHON_EGG_CACHE'] = '/Users/jsmits/.virtualenvs/trac/projects/mysite/eggs' | |
import trac.web.main | |
def app(environ, start_response): | |
return trac.web.main.dispatch_request(environ, start_response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(trac)[jsmits@imac:~/.virtualenvs/trac]$ gunicorn --workers=1 wsgi:app | |
2010-03-20 13:03:37 [88765] [INFO] Arbiter booted | |
2010-03-20 13:03:37 [88765] [INFO] Listening at: http://127.0.0.1:8000 | |
2010-03-20 13:03:37 [88766] [INFO] Worker spawned (pid: 88766) | |
2010-03-20 13:04:02 [88766] [ERROR] Error processing request. | |
Traceback (most recent call last): | |
File "/Users/jsmits/.virtualenvs/trac/lib/python2.6/site-packages/gunicorn/worker.py", line 153, in handle | |
response = self.app(req.read(), req.start_response) | |
File "/Users/jsmits/.virtualenvs/trac/lib/python2.6/site-packages/trac/web/main.py", line 420, in dispatch_request | |
return _dispatch_request(req, env, env_error) |
OlderNewer