James Dabbs @jamesdabbs Santa Barbara 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
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() |
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 'progressbar' | |
class Ant | |
attr_reader :x, :y | |
def initialize | |
@x, @y = 0, 0 | |
end | |
def move |
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 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 |
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> | |
<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> |
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 "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
- Have user accounts, with different roles for students and staff
- Staff can manage (general CRUD) books
- Anyone can check out a book, and are given a due date for when to return it
- When looking at a book, anyone can see who has it checked out currently (if anyone)
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
Element = Struct.new :datum, :next do | |
def tail? | |
!self.next | |
end | |
end | |
class SimpleLinkedList | |
attr_reader :size, :head | |
def self.from_a values |
NewerOlder