Skip to content

Instantly share code, notes, and snippets.

@stujo
stujo / advanced-active-record.md
Created February 24, 2015 22:29
Advanced Active Record Notes
@stujo
stujo / README.md
Created March 16, 2015 21:00
Rails vs Sinatra
class BQDatasetAuthorizer(ContextDecorator):
def __init__(self, target, profile_file):
self.target = target
self.profile_file = profile_file
# this dict maps a dataset to a list of BigQuery Access entries defined by code.
# We expect groupByEmail and View.
# https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.dataset.AccessEntry.html
self.auth_dict = defaultdict(list)
def __enter__(self):
@stujo
stujo / GitHub curl.sh
Last active February 15, 2019 21:39 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
#!/usr/bin/env bash
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
FILE_PATH="scripts/build/tabloid.sh"
FILE="https://api.github.com/repos/$OWNER/$REPO/contents/$FILE_PATH"
curl --header "Authorization: token $TOKEN" \
--header 'Accept: application/vnd.github.v3.raw' \
@stujo
stujo / oojs.md
Last active June 27, 2018 05:31
Object Oriented JavaScript

#Object Oriented Javascript

#Overview

  • Creating Objects in JavaScript
    • new Object();
    • Object Literal Notation (Important)
    • Factory Function
  • Review JavaScript's this
  • More Creating Objects in JavaScript
  • Constructor Function
@stujo
stujo / jasmine.md
Created October 17, 2014 17:18
Jasmine

#Due Monday

P 5-9 Due Monday along with P10 MVP Outline as Issue On Challenge P10 Presented on Friday

P7 Reviews

#Jasmine - Unit Testing for JavaScript

@stujo
stujo / what-is-an-api.md
Created October 20, 2014 16:12
What Is An API?

#What is an API?

#Overview

  • What is an API?
  • Consumption: Omdbapi Example
  • Providing: PetWorld
  • Challenge Prep
  • Review

#What is an API?

@stujo
stujo / exception-handling.md
Created October 23, 2014 16:21
Exceptions

#Exception Handling

#Bullet Points

  • raise or fail

#Demo / Live-code Overview

  • Custom StandardError class
  • raise makes RuntimeError with argument as message
@stujo
stujo / oojs.md
Created November 4, 2014 17:00
OO Js

#Object Oriented Javascript TODO

#Overview

  • Creating Objects in JavaScript
    • new Object();
    • Object Literal Notation (Important)
    • Factory Function
  • Review JavaScript's this
  • More Creating Objects in JavaScript
  • Constructor Function
@stujo
stujo / event-driven-programming.md
Created November 4, 2014 22:32
Event Driven Javascript

#Event Driven Programming

#Overview

#First-class nature of functions