Skip to content

Instantly share code, notes, and snippets.

View cds-amal's full-sized avatar
🏠
Working from home

cds-amal cds-amal

🏠
Working from home
  • Flushing USA
View GitHub Profile
from jsl import StringField, IntField
from .skeleton import Skeleton
class Procurement(Skeleton):
'''Example to show how to inherit/extend an entity.
This class will generate this schema: https://crow-schema.herokuapp.com/#procurement.json
'''
class Options(object):
from schematics.models import Model
from schematics.types import StringType, IntType
class Agency(Model):
'''Model an Agency
request - request blah blah blah
typeOfNotice - type of notice blah blah
divisionId - some fancy dancy division id
'''
{
// What should address be renamed to, in order to conform to the
// crow web app?
//
"addresses": [
{
"refLocation": [
{
"@context": "http://schema.org",
"@type": "Place",
@cds-amal
cds-amal / gist:17fc766c8e1d93970fb7
Created June 6, 2015 03:50
Training data for CROW notice Floor & Room address types
22 Reade Street, 2nd Floor Conference Room, New York, NY
55 Water Street, 9th Floor, Room 945, New York, NY
150 William Street, 9th Floor - Conference Room 9C-1, Borough of Manhattan, New York
59-17 Junction Boulevard, 17th Floor Conference Room, Flushing, New York
180 Water Street, 14th Floor, Room 1418, New York, NY 10038
55 Water Street, 9th Floor, Room 94, New York, NY
100 Church Street, 12th Floor, Training Room #143, New York, N.Y. 10007
{u'alleyCrossStreetsFlag': u'X',
u'assemblyDistrict': u'60',
u'bbl': u'3044310100',
u'bblBoroughCode': u'3',
u'bblTaxBlock': u'04431',
u'bblTaxLot': u'0100',
u'boardOfElectionsPreferredLgc': u'1',
u'boePreferredStreetName': u'VANDALIA AVENUE',
u'boePreferredstreetCode': u'38725001',
u'boroughCode1In': u'3',
#!/bin/bash
usage ()
{
cat <<UsageHERE
boot2docker-fwd -- Helper function to quickly manage port forwards between the boot2docker-vm and the host
Usage: boot2docker-fwd [ -n RULE_NAME ] [ -h HOST_PORT ] [ -p {tcp|udp} ] [ -i HOST_IP ] GUEST_PORT
or boot2docker-fwd -d RULE_NAME
or boot2docker-fwd -l
or boot2docker-fwd -A
var values = [118080, 168480,202500];
for (var a = 1; a < 100; a++) {
for (var b = a + 1; b < 100; b++) {
if (a + b > 180) break;
/*
* Start c at 1...
*/
for (var c = 1; c < 100; c++) {
/*
* Constrain on sum
### Keybase proof
I hereby claim:
* I am cds-amal on github.
* I am cdssudama (https://keybase.io/cdssudama) on keybase.
* I have a public key ASB8-gd4HFrhWVnVVhv5_6LuNpZoEzbc2pwp9YRWt808AAo
To claim this, I am signing this object:
@cds-amal
cds-amal / submodules.md
Created August 13, 2017 17:53 — forked from manasthakur/submodules.md
Using git submodules to version-control Vim plugins

Using git-submodules to version-control Vim plugins

If you work across many computers (and even otherwise!), it's a good idea to keep a copy of your setup on the cloud, preferably in a git repository, and clone it on another machine when you need. Thus, you should keep the .vim directory along with your .vimrc version-controlled.

But when you have plugins installed inside .vim/bundle (if you use pathogen), or inside .vim/pack (if you use Vim 8's packages), keeping a copy where you want to be able to update the plugins (individual git repositories), as well as your vim-configuration as a whole, requires you to use git submodules.

Creating the repository

Initialize a git repository inside your .vim directory, add everything (including the vimrc), commit and push to a GitHub/BitBucket/GitLab repository:

cd ~/.vim
// Cartesian product of arrays
// @takes N arrays -- arguments *must* be arrays
// @returns an array of X arrays of N elements, X being the product of the input arrays' lengths.
function cartesianProduct(...arrays) {
function _inner(...args) {
if (arguments.length > 1) {
let arr2 = args.pop(); // arr of arrs of elems
let arr1 = args.pop(); // arr of elems
return _inner(...args,