Skip to content

Instantly share code, notes, and snippets.

Sheeju Alex sheeju

  • India
View GitHub Profile
sheeju / agg.sql
Created Apr 16, 2018 — forked from ryandotsmith/agg.sql
Postgres array concatenation aggregate function.
View agg.sql
CREATE AGGREGATE array_accum (anyarray)
sfunc = array_cat,
stype = anyarray,
initcond = '{}'
sheeju /
Created Oct 31, 2017 — forked from akurani/
Create a Mac app for Zim Wiki.
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), 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(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
sheeju / vimrc
Created May 30, 2016 — forked from breezhang/vimrc
simple good vimrc for perl
View vimrc
"copy from
set nocompatible
set bs=2
set expandtab
set ts=4
set shiftwidth=4
set textwidth=78
set nowrap
set ruler
set autowrite
sheeju / System
Last active Apr 18, 2016 — forked from vasanthk/System
System Design Cheatsheet
View System

#System Design Interview Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
# Copyrights 2007-2012 by Mark Overmeer.
# For other contributors see ChangeLog.
# See the manual pages for details on the licensing terms.
# Pod stripped from pm file by OODoc 2.00.
# This pm file demonstrates how a client-side and server-side definition
# of a message can be created, in case there is no WSDL for the SOAP
# interface. This same module is used in both and
package MyExampleCalls;
#!/usr/bin/env perl
use warnings;
use strict;
use XML::Compile::WSDL11;
use XML::Compile::SOAP11;
use XML::Compile::Transport::SOAPHTTP;
use HTTP::Tiny;
package Logger;
use Moose;
has 'fout', is => 'ro', lazy_build => 1;
has 'filename', is => 'ro';
sub _build_fout {
my $self = shift;
my $fh;
sheeju /
Last active Aug 29, 2015 — forked from ynonp/
package Course;
use Moose;
has 'students' => (
is => 'ro',
isa => 'ArrayRef[Student]',
default => sub { [] },
sub add_student {
You can’t perform that action at this time.