This file contains hidden or 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 'date' | |
| require 'active_support/core_ext/integer/inflections' # Used for printing date as human text | |
| require 'holidays' # Gives access to holiays | |
| class Payday | |
| def initialize(query_date) | |
| @query_date = query_date | |
| @next_payday = 'unknown' | |
| end |
This file contains hidden or 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
| def check_admin_devices | |
| count = 0 | |
| AdminDevice.limit.all.each do |admin_device| | |
| device = Device.find(admin_device.id) | |
| unless device.last_run_time_tester | |
| puts "'last_run_time_tester' was false: #{admin_device.description}" | |
| count += 1 | |
| end | |
| end |
This file contains hidden or 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 'benchmark' | |
| def janky(length) | |
| start_time = Time.now | |
| (1..length).each { |num| num } | |
| time = Time.now - start_time | |
| time | |
| end | |
| def benchmarked(length) |
This file contains hidden or 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
| <form action="/cards" method="post" id="payment-form"> | |
| <div class="form-row"> | |
| <script type="text/javascript" src="https://js.stripe.com/v1/"> | |
| <script type="text/javascript"> | |
| // this identifies your website in the createToken call below | |
| $(document).ready(function(){ | |
| Stripe.setPublishableKey('pk_07T3vzpNsDZ1R1f6EXJUiQKC0u0qK'); | |
| }); |
This file contains hidden or 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
| RouterTester::Application.routes.draw do | |
| get "managers/index" | |
| get "managers/show" | |
| get "managers/new" | |
| get "managers/create" | |
| get "managers/update" |
This file contains hidden or 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
| RouterTester::Application.routes.draw do | |
| resources :companies do | |
| member do | |
| put 'location' | |
| end | |
| end | |
| resources :managers do |
This file contains hidden or 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 'active_record' | |
| require 'sqlite3' | |
| require 'logger' | |
| # ActiveRecord::Base.logger = Logger.new(STDOUT) | |
| ActiveRecord::Base.establish_connection :adapter => 'sqlite3', | |
| :database => 'address_book.db' | |
| ActiveRecord::Base.connection.execute <<-SQL |
This file contains hidden or 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 'active_record' | |
| require 'sqlite3' | |
| ActiveRecord::Base.establish_connection :adapter => 'sqlite3', | |
| :database => 'db/students.db' | |
| ActiveRecord::Base.connection.execute <<SQL | |
| CREATE TABLE IF NOT EXISTS students ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| first_name VARCHAR NOT NULL, | |
| last_name VARCHAR NOT NULL, | |
| birthday DATE, |
This file contains hidden or 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
| // David Ladowitz | |
| // start time: 8:00pm | |
| // Exercise 1.................................................... | |
| var newConcat = function(first, last){ | |
| return (first + last) | |
| }; | |
| newConcat('david', 'ladowitz') |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ --> | |
| <!-- Active URL: http://socrates.devbootcamp.com/sql.html --> | |
| <sql> | |
| <datatypes db="mysql"> | |
| <group label="Numeric" color="rgb(238,238,170)"> | |
| <type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/> | |
| <type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/> | |
| <type label="Single precision" length="0" sql="FLOAT" quote=""/> | |
| <type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/> |