Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dannyc5 on github.
  • I am danielchang (https://keybase.io/danielchang) on keybase.
  • I have a public key ASAdaYC7kgk66TO97nCf8txMA8ohHl23PyhK4pKCoiOYvgo

To claim this, I am signing this object:

# some-json.txt
# [
# {
# "a": [
# "b", 1
# ]
# }
# ]
import json
module B
def bee
p cee
end
end
module C
def cee
'hi'
end
@dannyc5
dannyc5 / scope_example.rb
Created April 20, 2017 15:26
ruby scope w mixins
module B
def bee
p cee
end
end
module C
def cee
'hi'
end

Responsibilities:

  • make http req
    • GET
      • MUST SUPPORT QUERY PARAMS
    • POST
      • METHOD POST WITH DATA BODY, MUST SUPPORT QUERY PARAMS
    • PATCH
      • METHOD PATCH WITH DATA BODY
    • DELETE
  • METHOD DELETE, NO BODY
@dannyc5
dannyc5 / resource-fetch.js
Last active April 28, 2016 20:13
Allow app to fetch resources with syntactic sugar ~~ client.resource('user.company').get
// client.js
import resourceRoutes from 'resource-routes'
export default {
resource(resourceName, params) {
let formattedResourceName = this._parseName(resourceName)
let resourceURIs = resourceRoutes.urlFor(formattedResourceName, params)
return this._withResourceURIs(resourceURIs);
},
@dannyc5
dannyc5 / project_mode_notes.md
Created December 23, 2015 04:58
Project Mode Notes

Project Mode

  • A project is a subclass of content (for now until we get rid of content subclasses)
  • A ReceiveReviewAssessment is a subclass of Assessm. "Ready for Review"/"Your Project" light
  • A GiveReviewAssessment is a subclass of Assessm. "Peer Review" light

ReceiveReviewAssessment STATUS LIGHTS + TEXT

  • self-review Not yet started: Gray "Ready for Review"
  • self-review Begun: Yellow "Ready for review"
@dannyc5
dannyc5 / SQL cheatsheet
Created May 7, 2015 04:37
SQL cheatsheet
-- SQL Basic Syntax --
--initialize SQLite database w/ command line:
sqlite3 database_name.db
--helpful commands
.help -- list of commands
.tables -- see all tables
.mode column / .header on -- helpful for viewing