This file has been truncated, but you can view the full file.
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
{ | |
"id": "5748e073-d838-4100-bce5-8d41df5a38a2", | |
"status": "closed", | |
"reference": "57752", | |
"number": 186, | |
"scheduled": "2018-12-03T01:20:00+00:00", | |
"attendance": 61069, | |
"utc_offset": -5, | |
"entry_mode": "INGEST", | |
"weather": "Clear Temp: 57 F, Humidity: 55%, Wind: From S 8 mph", |
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
{ | |
"scripts": { | |
"test": "NODE_PATH='./app/javascript/node_modules:./app/javascript' jest", | |
"test:watch": "yarn test --watch", | |
"test:coverage": "test --coverage" | |
}, | |
"jest": { | |
"roots": [ | |
"./app/javascript" | |
], |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<video controls class="handsome"></video> | |
<body> | |
<script> | |
const video = document.querySelector('.handsome'); |
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 Benchwarmer | |
attr_reader :results | |
class << self | |
def run(options = {gc: :enable}) | |
if options[:gc] == :disable | |
GC.disable | |
elsif options[:gc] == :enable | |
# collect memory allocated during library loading | |
# and our own code before the measurement |
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
require 'lhm' | |
class AddDateTimeColumnsToNpsSurveys < ActiveRecord::Migration | |
def up | |
Lhm.change_table :nps_surveys do |m| | |
m.add_column :survey_created_at, 'DATETIME AFTER `survey_created_at_epoch`' | |
m.add_column :survey_updated_at, 'DATETIME AFTER `survey_created_at_epoch`' | |
end | |
end | |
def down |
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
require 'rails_helper' | |
describe 'ruby 2.2.0' do | |
context "Enumerable methods" do | |
# slice_before, slice_after and slice_when return Enumerable | |
describe "#slice_before" do | |
it "slices before a matched singular value" do | |
a = ["a", "b", "c"] |
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
require 'rails_helper' | |
describe 'ruby 2.3.0' do | |
context "Integer methods" do | |
describe "positive?" do | |
it "checks if an array value is greater than zero" do | |
some_array = [2,3,4] | |
expect(some_array.first.positive?).to eq true |
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
describe "counter caches" do | |
it "increments associations when created" do | |
user = User.create(first_name: "David", last_name: "Moore", email:"[email protected]") | |
#creating a thread with the user | |
user.forum_threads.create(name:"First thread") | |
expect(user.forum_threads_count).to eq 1 | |
#create a thread with its own class and associating it to the user |
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 python | |
# Eulerian Tour Ver 1 | |
# | |
# Write a function, `create_tour` that takes as | |
# input a list of nodes | |
# and outputs a list of tuples representing | |
# edges between nodes that have an Eulerian tour. | |
# |
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
# == Schema Information | |
# | |
# Table name: users | |
# | |
# id :integer not null, primary key | |
# email :string(255) default(""), not null | |
# encrypted_password :string(255) default(""), not null | |
# reset_password_token :string(255) | |
# reset_password_sent_at :datetime | |
# remember_created_at :datetime |