Skip to content

Instantly share code, notes, and snippets.

View dchapman1988's full-sized avatar

David Chapman dchapman1988

View GitHub Profile
delay100ms
pshx
ldx #60000 ; 2 E cycles
iloop psha ; 2 E cycles
pula ; 3 E cycles
psha ; 2 E cycles
pula ; 3 E cycles
psha ; 2 E cycles
pula ; 3 E cycles
psha ; 2 E cycles
; Name: David Chapman
; Program: Lab 02
; Version: 1.0
; Date Started: 10/15/2014
; Last Update: NA
; Copyright © 2014
;
; Description: Implement a counter that increments the count when SWX is
; pressed and clears the count when SWY is pressed. The count
; is to be displayed via the four LEDs that were used in the
@dchapman1988
dchapman1988 / time_sync.sh
Created November 25, 2014 17:58
Just a shell script to force a time sync.
( /etc/init.d/ntp stop
until ping -nq -c3 8.8.8.8; do
echo "Waiting for network..."
done
ntpdate -s time.nist.gov
/etc/init.d/ntp start )&
Check for coverage amounts
dp1,wind only other structers = rcv
FLood - always no
Wind and Hail - always yes
earthquake - no
collapse - no
water damage - dp1 = no, dp2 = yes, wind only = no
theft - other coverage means contents = yes
remote: http://rubygems.org/ |
specs:
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'file_decrypter'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
def show
if current_user
unless current_user.stocks?
redirect_to root_path, :notice => "You need to add some stocks first."
end
@stocks = current_user.stocks
else
redirect_to new_user_session_path
end
end
@dchapman1988
dchapman1988 / Admin Index View
Created June 23, 2011 15:36
Problem updating all stocks...
# As the method, I have tried :put and :update.
= button_to 'Update all quotes', admin_panel_path, :method => :put
%h2 Admin Control Panel
%br/
%div{ :style => "float:left;" }
%h3 Add stocks
%br/
= form_tag(new_admin_stock_path, :method => :get) do
= label_tag(:symbol, "Symbols")
%br/
= text_area_tag(:symbol, nil, :cols => 30, :rows => 10)
%br/
def index
if current_user.admin
@stocks = Stock.all
else
redirect_to root_path
flash[:error] = "You must be an administrator to access this page!"
end
end