Skip to content

Instantly share code, notes, and snippets.

View rohitpaulk's full-sized avatar

Paul Kuruvilla rohitpaulk

View GitHub Profile
execute pathogen#infect()
syntax enable
filetype plugin indent on
" Set line numbers on
set number
" Solarized https://github.com/altercation/vim-colors-solarized
set background=dark
colorscheme solarized
@rohitpaulk
rohitpaulk / struct.rb
Created October 8, 2017 17:21
Ruby's Struct
# Create a new class from Struct
Customer = Struct.new(:name, :address)
#=> Customer
Customer.new("Dave", "123 Main")
#=> #<struct Customer name="Dave", address="123 Main">
@rohitpaulk
rohitpaulk / struct_no_keyword.rb
Last active October 8, 2017 17:30
Ruby's Struct doesn't allow keyword arguments
Point = Struct.new(:x, :y)
# Allowed by default: positional arguments
p = Point.new(1, 2)
# What I wish was allowed: keyword arguments
p = Point.new(x: 1, y: 2)
@rohitpaulk
rohitpaulk / named_struct.rb
Last active September 8, 2019 19:33
NamedStruct
class NamedStruct < Struct
# Allows initialization via keyword arguments. By default, Ruby
# only allows positional arguments.
def initialize(**kwargs)
super(*members.map{|k| kwargs[k] })
end
end
use teamcom_shard_01;
DROP TABLE IF EXISTS contacts_test;
CREATE TABLE contacts_test (
name VARCHAR(255),
email VARCHAR(255) NOT NULL,
public TINYINT(1), -- Values are either NULL, or True
workspace_id INT(11) unsigned NOT NULL,
creator INT(11) unsigned NOT NULL
use teamcom_shard_01;
DROP TABLE IF EXISTS contacts_test;
CREATE TABLE contacts_test (
email VARCHAR(255) NOT NULL,
public TINYINT(1), -- Values are either NULL, or True
workspace_id INT(11) unsigned NOT NULL,
creator INT(11) unsigned NOT NULL
, UNIQUE KEY `only_one_public` (workspace_id, public, email)

Keybase proof

I hereby claim:

  • I am rohitpaulk on github.
  • I am rohitpaulk (https://keybase.io/rohitpaulk) on keybase.
  • I have a public key ASALGuPml2_DMms2tCBUrIF8MeCPIB-njkHBnF-mXw8NmQo

To claim this, I am signing this object:

from shell import shell
from datetime import date, timedelta
import json
from concurrent.futures import ThreadPoolExecutor
import csv
DAYS_IN_PAST = 10
from shell import shell
from datetime import date, timedelta
import json
from concurrent.futures import ThreadPoolExecutor
import csv
DAYS_IN_PAST = 180
from shell import shell
from datetime import date, timedelta
import json
from concurrent.futures import ThreadPoolExecutor
import csv
DAYS_IN_PAST = 180