[fit] Category Theory
[fit] For the Working Programmer
James Dabbs @jamesdabbs Santa Barbara JavaScript
import uuid from 'uuid/v4' | |
import { | |
Envelope, Token, User, | |
allUsers, deliverEmail, prompt, saveToken | |
} from '../util' | |
const promptFor = (message: string): string => { | |
console.log(message) | |
return prompt() |
require 'progressbar' | |
class Ant | |
attr_reader :x, :y | |
def initialize | |
@x, @y = 0, 0 | |
end | |
def move |
class Voice | |
BASELINE = %w( there is no - poop ing - on - the bus - ) | |
VOICES = `say -v '?'`.lines.map { |line| line.split.first } | |
def initialize &voice | |
@voice, @i = voice, -1 | |
end | |
def perform | |
advance |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-3.1.1.slim.js" integrity="sha256-5i/mQ300M779N2OVDrl16lbohwXNUdzL/R2aVUXyXWA=" crossorigin="anonymous"></script> | |
<script src="people.js"></script> | |
</head> | |
<body> | |
<button id="asdf">Click Me!</button> | |
</body> | |
</html> |
require "pry" | |
puts "Hello!" | |
puts "What is your name?" | |
name = "James" | |
# name = gets | |
# puts "Hello, " + name | |
puts "Hello, #{name}" |
Kaminari
helper for paginating lists (e.g. of search results) and displaying page lists (<< < ... 10 11 12 .. > >>)
Sidekiq
run jobs outside the request-response loop, so that users don't have to wait e.g. for email to send before getting their response page. Also useful for running scheduled jobs (e.g. every 3 hours)
Write an application that helps us manage the books in the Iron Yard lending library
GET /bots
Show your bots (usually only one)
State could be running
, stopped
or crashed
(in which case error
will be present)
[
{
"status":{
Element = Struct.new :datum, :next do | |
def tail? | |
!self.next | |
end | |
end | |
class SimpleLinkedList | |
attr_reader :size, :head | |
def self.from_a values |