Skip to content

Instantly share code, notes, and snippets.

Sheeju Alex sheeju

  • India
View GitHub Profile
@sheeju
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
sheeju / zim-wiki-mac-osx-app.md
Created Oct 31, 2017 — forked from akurani/zim-wiki-mac-osx-app.md
Create a Mac app for Zim Wiki.
View zim-wiki-mac-osx-app.md
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
sheeju / vimrc
Created May 30, 2016 — forked from breezhang/vimrc
simple good vimrc for perl
View vimrc
"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 Apr 18, 2016 — forked from vasanthk/System Design.md
System Design Cheatsheet
View System Design.md

#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?
View MyExampleCalls.pm
# 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;
View soap-calculator-client.pl
#!/usr/bin/env perl
use warnings;
use strict;
use XML::Compile::WSDL11;
use XML::Compile::SOAP11;
use XML::Compile::Transport::SOAPHTTP;
use HTTP::Tiny;
View 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 Aug 29, 2015 — forked from ynonp/76.pl
View 76.pl
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.