Skip to content

Instantly share code, notes, and snippets.

@randomecho
randomecho / australian-postcodes.sql
Last active April 11, 2024 12:08
Australian postcodes (with states and suburb names) geocoded with latitude and longitude.
/*
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod
May contain errors where latitude and longitude are off. Use at own non-validated risk.
*/
SET NAMES utf8;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS postcodes_geo;
@mapopa
mapopa / thin_init.sh
Created October 24, 2012 09:06
start thin in user rvm with env , solves /usr/bin/env: ruby_noexec_wrapper: No such file or directory
#!/bin/sh
### BEGIN INIT INFO
# Provides: thin
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: thin initscript
# Description: thin
### END INIT INFO
@ChadSikorra
ChadSikorra / DataTable.php
Created October 15, 2012 03:26
Symfony2 Doctrine DataTables.js (Related Entity Enabled)
<?php
/**
* Recognizes mData sent from DataTables where dotted notations represent a related
* entity. For example, defining the following in DataTables...
*
* "aoColumns": [
* { "mData": "id" },
* { "mData": "description" },
* { "mData": "customer.first_name" },
* { "mData": "customer.last_name" }
@kaa
kaa / carbon.init.sh
Created September 6, 2012 07:51 — forked from pkhamre/readme.markdown
Installing graphite 0.9.10 and statsd on Amazon Linux
#!/bin/bash
#
# Carbon (part of Graphite)
#
# chkconfig: 3 50 50
# description: Carbon init.d
. /etc/rc.d/init.d/functions
prog=carbon
RETVAL=0
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 7, 2024 15:24
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@Slauta
Slauta / src\Acme\UserBundle\Entity\UserRepository.php
Created July 25, 2012 09:30
DataTable server side for Symfony 2 Doctrine (ver 2)
<?php
namespace Acme\UserBundle\Entity;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr;
/**
* UserRepository
*
@Slauta
Slauta / src\Acme\UserBundle\Entity\UserRepository.php
Created July 25, 2012 09:21
DataTable server side for Symfony 2 Doctrine
<?php
namespace Acme\UserBundle\Entity;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr;
/**
* UserRepository
*
@rraptorr
rraptorr / stunnel-4.53-xforwarded-for.diff
Created June 25, 2012 17:50
X-Forwarded-For stunnel 4.53 patch
diff --git a/doc/stunnel.8 b/doc/stunnel.8
index 589d968..f56f5c0 100644
--- a/doc/stunnel.8
+++ b/doc/stunnel.8
@@ -693,6 +693,10 @@ This options has been renamed to \fInone\fR.
.RE
.RS 4
.RE
+.IP "\fBxforwardedfor\fR = yes | no" 4
+.IX Item "xforwardedfor = yes | no"
@danvega
danvega / webtail.js
Created April 24, 2012 02:37
NodeJs Tail to browser window
var http = require('http');
var spawn = require('child_process').spawn;
http.createServer(function(request,response){
response.writeHead(200,{
'Content-Type' : 'text/plain'
});
var directory = 'C:\\ColdFusion9\\logs\\';
@thehunmonkgroup
thehunmonkgroup / node-app
Last active June 1, 2022 20:27
Redhat init script for managing a NodeJS app via forever
#!/bin/sh
##
## Redhat / Linux / LSB
##
# chkconfig: 345 85 15
# description: Startup script for Express / Node.js application with the \
## forever module.
##
## A modification of https://gist.github.com/1339289
##