Skip to content

Instantly share code, notes, and snippets.

View besquared's full-sized avatar

Josh Ferguson besquared

View GitHub Profile
@besquared
besquared / stacked-area-100pct.json
Created January 30, 2017 02:51 — forked from randyzwitch/stacked-area-100pct.json
Vega Stacked Area 100%
{
"width": 500,
"height": 200,
"padding": "auto",
"data": [
{
"name": "table",
"values": [
{"x": 0, "y": 28, "c":0}, {"x": 0, "y": 55, "c":1},
{"x": 1, "y": 43, "c":0}, {"x": 1, "y": 91, "c":1},
@besquared
besquared / data.csv
Last active January 28, 2017 02:00 — forked from d3noob/data.csv
Discontinuous Path with Isolated Points
date close
2-May-12 65.07
1-May-12 null
30-Apr-12 null
29-Apr-12 60.05
28-Apr-12 null
27-Apr-12 67.00
26-Apr-12 89.70
25-Apr-12 99.00
24-Apr-12 130.28
# Match [ [1,2,3], [4,5,6], ... ]
class Matrix
constructor(@rows) -> null
Matrix: [
o 'LEFT_BRACKET (MatrixRow)+ RIGHT_BRACKET', ->
new Matrix($2)
]
public class WebBase : NancyModule
{
private ExponentiallyDecayingSample _sample;
public WebBase()
{
Setup();
Get["/sampling"] = param =>
{
<h1 id="header"></h1>
<ul id="list current-name">
<li class="item current"><strong></strong></li>
<li class="item"><a href="#" class="link"></a></li>
</ul>
<p id="empty">The list is empty.</p>
<html>
<head>
<title>My Web Page</title>
</head>
<body>
<h1>Welcome to my web page</h1>
<p>This is my web page, and stuff</p>
</body>
</html>
module MyModule
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def my_method
@myvar ||= 0
end
#
# This is probably a decent interview assignment
#
# Pivot Function
#
# The pivot function takes the unique values of a table column and turns them into
# columns of a new table, with the values of the new cells being chosen from a column
# in the original table
#
# Example:
event_msg = Protopuffs::Message::Event.new(:id => "4e09c87fc4d4468783d4a42a8ed72969",
:user_id => user_id,
:created_at => Time.now.utc.to_i)
response_body = event_msg.to_wire_format
content_length = response_body.length
response_code = '201 Created'
event_response = ERB.new(File.read(Rails.root.join("features/step_definitions/response_templates/response.erb")), nil, '-').result(binding)
FakeWeb.register_uri(:post, "http://api.rupture.com/events", :response => event_response)
{rpapi_web,dispatch_request,'POST',"/events",catastrophic_error,
{function_clause,
[{rpcore_event,create,
[{event,"ccb2bdf42ad947d2b03e3fc215199fb5",
"b9e42eb1f6bbd08c1a2da170d8b5f809",
"6e4cfc5c-13ee-11de-8dd3-ce2c6fab0d3d","challenge",
"official_challenge","rupture_internal","Rupture",
"Challenges","watching the attempt","challenge",undefined,
undefined,undefined,undefined,undefined,undefined,undefined,
undefined,undefined,undefined,undefined,undefined,"Dalaran",