use json_encode
if php is not setup in your machine use this http://json_encode.onlinephpfunctions.com/
make sure the php version is recent or else you won't get your json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Based on this https://news.ycombinator.com/item?id=20495739 | |
# I created this boilerplate which I think is a bit nicer to use. | |
import sys | |
class AttrDict(dict): |
Service | SSL | status | Response Type | Allowed methods | Allowed headers |
---|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class @GoogleAnalytics | |
@load: -> | |
# Google Analytics depends on a global _gaq array. window is the global scope. | |
window._gaq = [] | |
window._gaq.push ["_setAccount", GoogleAnalytics.analyticsId()] | |
# Create a script element and insert it in the DOM | |
ga = document.createElement("script") | |
ga.type = "text/javascript" |
- specs go in the "spec" directory
- specs end in "_spec.rb"
- toplevel begins with
describe
- inside of a
describe
you have anit
example
is an alias forit
- inside of
it
blocks, you write your code and assertions - run with
$ rspec
or$ rspec spec/some_spec.rb
- if you need common setup (e.g. add another dir to the load path), put into "spec/spec_helper.rb" and then `require "spec_helper" at the top of the spec
- using
let
will allow you to name a value that you want to call from your spec,