Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sheeju on github.
  • I am sheeju (https://keybase.io/sheeju) on keybase.
  • I have a public key ASB16E8QCvKDGcG2_FasgDPQHL--bKvXJmTvn7tOcTQfXAo

To claim this, I am signing this object:

@sheeju
sheeju / agg.sql
Created April 16, 2018 13:29 — forked from ryandotsmith/agg.sql
Postgres array concatenation aggregate function.
CREATE AGGREGATE array_accum (anyarray)
(
sfunc = array_cat,
stype = anyarray,
initcond = '{}'
);
@sheeju
sheeju / zim-wiki-mac-osx-app.md
Created October 31, 2017 11:01 — forked from akurani/zim-wiki-mac-osx-app.md
Create a Mac app for Zim Wiki.
@sheeju
sheeju / postgres_queries_and_commands.sql
Created October 26, 2017 12:01 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- 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
sheeju / vimrc
Created May 30, 2016 23:43 — forked from breezhang/vimrc
simple good vimrc for perl
"copy from http://publius-ovidius.livejournal.com/242806.html
set nocompatible
set bs=2
set expandtab
set ts=4
set shiftwidth=4
set textwidth=78
set nowrap
set ruler
set autowrite
@sheeju
sheeju / System Design.md
Last active April 18, 2016 03:05 — forked from vasanthk/System Design.md
System Design Cheatsheet

#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 client.pl and server.pl.
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;
@sheeju
sheeju / 58_logger.pl
Last active August 29, 2015 14:06 — forked from ynonp/58_logger.pl
package Logger;
use Moose;
has 'fout', is => 'ro', lazy_build => 1;
has 'filename', is => 'ro';
sub _build_fout {
my $self = shift;
my $fh;
@sheeju
sheeju / 76.pl
Last active August 29, 2015 14:06 — forked from ynonp/76.pl
package Course;
use Moose;
has 'students' => (
is => 'ro',
isa => 'ArrayRef[Student]',
default => sub { [] },
);
sub add_student {