Test Title
heading
PARAGRAPH starts here.
Then continues on for a bit.
echo "Creating an SSH key for you..." | |
ssh-keygen -t rsa | |
echo "Please add this public key to Github \n" | |
echo "https://github.com/account/ssh \n" | |
read -p "Press [Enter] key after this..." | |
echo "Installing xcode-stuff" | |
xcode-select --install |
;; helper functions | |
(defun kb/project-dir () | |
"returns the current project's root path" | |
(let* ((pr (project-current t)) | |
(pr-dir (project-root pr))) | |
pr-dir)) | |
(defun kb/project-concat (path) | |
"appends provided path onto the current project's root path" |
# https://guides.rubyonrails.org/active_record_callbacks.html#halting-execution | |
class Org < ApplicationRecord | |
before_destroy do | |
throw :abort unless no_user? | |
end | |
end |
/* | |
Solar system objects | |
Adapted from: http://en.wikipedia.org/wiki/List_of_Solar_System_objects_by_size | |
Collected by: https://www.khanacademy.org/profile/patrick809/programs | |
*/ | |
CREATE TABLE solar_system_objects( | |
body TEXT | |
, mean_radius NUMERIC /* km */ | |
, mean_radius_rel NUMERIC /* relative to earth */ | |
, volume NUMERIC /* 10^9 km^3 */ |
/* | |
Sales from an online furniture store | |
Collected by: https://www.khanacademy.org/profile/charlesb2000/ | |
*/ | |
CREATE TABLE sales( | |
ID INTEGER NOT NULL PRIMARY KEY | |
, transaction_date TEXT | |
, product TEXT | |
, price INTEGER | |
, payment_type TEXT |
def counts(str) | |
str.chars.inject([]) do |memo, e| | |
if memo.last && memo.last[0].eql?(e) | |
memo.last[1] += 1 | |
else | |
memo << [e, 1] | |
end | |
memo | |
end |
class Test | |
def run | |
puts ">>> starting test run: #{self.class.name}" | |
setup | |
the_test_methods.each do |test_method| | |
puts "running #{self.class.name}##{test_method}" | |
send(test_method) | |
end | |
end |
PARAGRAPH starts here.
Then continues on for a bit.
// Require the REPL module | |
// and models | |
let repl = require('repl').start({}); | |
const models = require('./models'); | |
// Make the `models` object | |
// a global variable in the | |
// REPL | |
repl.context.models = models; |
#!/usr/bin/env ruby | |
#/ Usage: <progname> [options]... | |
#/ How does this script make my life easier? | |
# ** Tip: use #/ lines to define the --help usage message. | |
$stderr.sync = true | |
require 'optparse' | |
# default options | |
flag = false | |
option = "default value" |