Skip to content

Instantly share code, notes, and snippets.

@alizain
alizain / aggregate.py
Last active January 22, 2018 22:52
Some work I'm proud of (from the same project)
from itertools import groupby
from collections import OrderedDict
from core.mixins.struct import Struct
from cost.envelope import Envelope
from cost.models.production_report import ProductionReport
from cost.services.periods import TODAY
from cost.services.line_item.lookup import lookup_model_parent
from cost.services.line_item.previous import get_previous_parents_like
from cost.services.production_report.aggregate import aggregate_report_list
@alizain
alizain / a_service.ex
Created January 19, 2018 19:15
Sample Elixir code
require IEx
defmodule Volunteer.Legacy do
alias Ecto.Changeset
alias VolunteerEmail.Mailer
import Bamboo.Email
import Bamboo.Phoenix
@all_jamatkhanas [

Keybase proof

I hereby claim:

  • I am alizain on github.
  • I am alizainf (https://keybase.io/alizainf) on keybase.
  • I have a public key whose fingerprint is F33B 9386 BAFA 6383 2C0F 4429 D16C 0907 C6FB FE38

To claim this, I am signing this object:

@alizain
alizain / conster.js
Created August 15, 2016 14:19
Make chainable string constants
/**
* Usage:
*
* ```
* let c = conster('|')
*
* let auth = c('AUTH')
* auth('LOGGED_IN')() ->> 'AUTH|LOGGED_IN'
*
* let nav = c('NAV')
@alizain
alizain / lisp.js
Created August 5, 2016 22:49
A simple LISP interpreter with a simple program in JS
function lisp(prog) {
let func = prog[0]
if (typeof func !== 'function') return func
return func.apply(null, prog.slice(1).map(function(a) {
return Array.isArray(a) ? lisp.call(null, a) : a
}))
}