Skip to content

Instantly share code, notes, and snippets.

View featherart's full-sized avatar
🎯
Focusing

Feather featherart

🎯
Focusing
View GitHub Profile
@featherart
featherart / gist:6802810
Created October 3, 2013 00:43
ATM spec file
Specification:
Keep track of the checking and savings balances somewhere
Add functionality so that a user can deposit money into one of the bank accounts.
Make sure you are updating the display and manipulating the HTML of the page so a user can see the change.
Add functionality so that a user can withdraw money from one of the bank accounts.
Make sure you are updating the display and manipulating the HTML of the page so a user can see the change.
Make sure the balance in an account can't go negative. If a user tries to withdraw more money than exists in the account, ignore the transaction.
When the balance of the bank account is $0 the background of that bank account should be red. It should be gray when there is money in the account.
What happens when the user wants to withdraw more money from the checking account than is in the account? These accounts have overdraft protection, so if a withdrawal can be covered by the balances in both accounts, take the checking balance down to $0 and take the rest of the
@featherart
featherart / gist:6877509
Created October 8, 2013 00:29
javascript for tic-tac-toe
// name_of_obj.name_of_key_in_object => value_associated_with_that_key
var board = [
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]
];
// Variable to store the winning player.
var winningPlayer= 0;
@featherart
featherart / gist:6877514
Created October 8, 2013 00:30
css for javascript
body {
width: 100%;
background-image:url('../img/wavegrid.png');
}
#main_container {
margin: 10px auto;
width: 800px;
}
@featherart
featherart / gist:6912049
Created October 10, 2013 02:22
Review Haiku HW
Book Review Haiku
This is an app to store a list of your favorite books with reviews in the form of Haikus for each book.
Create a Sinatra app that reads from/writes to a .erb file
The .erb file should include a form to enter a new book
the form should have a text input field for title, author, and a block input field for the haiku
The .erb file should list your books and haiku reviews
The list of reviews should persist, so you will need a database! There is only one table required, Books. This table should have 3 fields: Title, Author, and Review
Bonus items!
@featherart
featherart / gist:7000647
Created October 16, 2013 00:10
HW 10/15/2013
@featherart
featherart / gist:7109061
Last active December 26, 2015 06:39
FredMailer or UserMailer
# There are 4 basic steps to implementing your ActionMailer functionality in a Rails app:
# Step 1. Create your ActionMailer object. Remember that it can have any name, but should finish with "Mailer":
rails g mailer UserMailer
class UserMailer < ActionMailer::Base
default from: "fred@fred.com"
def confirm_user(user)
@user = user
@featherart
featherart / gist:7206982
Created October 29, 2013 00:00
Homework for 10/28 WDI
Please write some tests for your first Project. This is backwards from the way it "should" be
-- haha, some Rspec humor for ya!!
Make sure to include at least one Model test and one Controller test. These are tests for
your Ruby code only.
I will randomly call on students in each class to describe the tests they wrote and why, so
please do your homework! :)
Tomorrow we will learn about testing in JavaScript. If you want to do some reading up ahead
@featherart
featherart / controllers.application.js
Created November 30, 2016 20:40
composable helpers
import Ember from 'ember';
import joinWith from '../utils/join-with';
export default Ember.Controller.extend({
firstName: 'Jim',
lastName: 'Bob',
fullName(): joinWith('', 'firstName', 'lastName')
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Component.extend({
});