Skip to content

Instantly share code, notes, and snippets.

@kahneraja
kahneraja / welcome-thin-client.json
Last active March 20, 2019 18:22
DRAFT Welcome Box (Thin Client)
{
"type": "single_type",
"id": "weclome",
"data": {
"copy": "Hi Sofie, your Value\nis $625.22",
"copy_highlight": ["625.22"],
"tooltip": {
"title": "Your Value",
"content": "Aggregate value of all accounts"
}
@kahneraja
kahneraja / contact-data-client.json
Last active March 20, 2019 18:23
Snapshot Data Driven (Smart Clients)
{
"type": "single_type",
"id": "snapshot",
"data": {
"invest": {
"title": "Personal",
"value": 12673,
"accounts": [
{
"title": "’",
@kahneraja
kahneraja / snapshot-contract.json
Last active March 20, 2019 21:05
Final Snapshot Contact
[
{
"type": "single_type",
"id": "snapshot",
"data": {
"personal": {
"title": "Personal",
"balance": "$294.02",
"info": "Next milestone: $500",
"percentages": [
@kahneraja
kahneraja / gist:d1078f95ee09091018a18afa372f1794
Last active January 5, 2018 15:12
Exploring Interfaces in Scala
trait Vehicle {
def drive = {
println("drive vehicle")
}
}
trait Boat extends Vehicle {
@kahneraja
kahneraja / gist:4199a2ccb621a7e15842a4d64a9d4f38
Last active January 5, 2018 14:40
Exploring Super Interfaces in Java 8.
/* INTERFACES */
interface Plane {
default void drive() {
System.out.println("We are driving a plane!");
}
}
@kahneraja
kahneraja / gist:cc8f47e3a0eb876ef2f4c94f21cdc90a
Created December 21, 2017 15:48
SCALA WORKSHEET: Some ideas around how a Use Case pattern might help.
// REQUESTVAlIDATORS
trait RequestValidator {
def Validate(): Boolean // various approaches to validating http requests
}
// AUTHPOLICIES
trait AuthPolicy {
def Authorize() // handle user context and various exceptions
}
@kahneraja
kahneraja / gist:0caeb89486c9cc33ddcab225b5e9c01f
Last active December 20, 2017 19:23
Scala Worksheet: How to inject an implicit value into a Play json serializer...?
import play.api.libs.json._
import play.api.libs.json.Reads._
import play.api.libs.functional.syntax._
case class GlobalConfig(defaultAge: Int)
val config = GlobalConfig(34)
case class Person(name: String, age: Int)
object Person {
/*
To run locally...
$> npm install mocha -g
$> mocha bastille.spec.js
*/
"use strict";
var assert = require("assert");
var Bastille = function (){

Big Theta Notation: Actual complexity. Big O Notation: Worst case complexity. Big Omega notation: Best ase complexity.

Standard function asymptotic analysis.

  • Constant: O(1)
  • Linear: O(N)
  • One nested loop: O(N^2)
  • Binary Tree Search: O(Log N)
  • Simple recursive function: O(N)