Skip to content

Instantly share code, notes, and snippets.

View damog's full-sized avatar
#neverstop

David Moreno damog

#neverstop
View GitHub Profile
@simonista
simonista / .vimrc
Last active April 4, 2025 11:55
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@reyjrar
reyjrar / client_by_network.sql
Created October 14, 2012 10:20
Grouping IP's by /24's in PgSQL
select
CAST(regexp_replace( CAST( ip | inet '0.0.0.255' as TEXT), '255/32$', '0') || '/24' as inet) as network,
regexp_replace( CAST( ip | inet '0.0.0.255' as TEXT), '255/32$', '0') as network_addr,
count(1) as clients,
to_char(min(first_ts), 'YYYY-MM-DD HH24:MI') as first_ts,
to_char(max(last_ts), 'YYYY-MM-DD HH24:MI') as last_ts,
bool_or(is_local) as is_local
from client
group by ip | inet '0.0.0.255'
@miyagawa
miyagawa / resque.pl
Created November 3, 2009 20:27
Resque client in Perl
package Resque;
use Any::Moose;
use Redis;
use JSON;
has server => (is => 'rw', isa => 'Str', default => 'localhost:6379');
has redis => (is => 'rw', isa => 'Redis', lazy_build => 1);
sub _build_redis {
my $self = shift;