Skip to content

Instantly share code, notes, and snippets.

View iheartkode's full-sized avatar
💭
Working on game dev

Mark iheartkode

💭
Working on game dev
View GitHub Profile
Wildlife tracker
They've asked you and your pair to build an app so that the rangers can report wildlife sightings.
Start out by letting users CRUD/L (create, read, update, destroy, list) species.
Next, allow them to input a sighting of an animal, along with the date, latitude, and longitude. (Hint: a species has many sightings.) Add CRUD functionality for these sightings.
Now, the area under consideration has been divided into several regions. Build out CRUD/L functionality for regions, and when a user reports a sighting, have them choose the region from a drop-down menu. (Hint: do a web search for html drop-down mdn.)
Bonus: let users run reports to list all the sightings during a given time period.
Extra Bonus: finally, let users narrow their reports down to a particular region.
@iheartkode
iheartkode / loops.rb
Created May 27, 2015 07:01
common loops in ruby
names = ["bob", "susan", "steve"]
# goes through each name in the array then makes a variable name and puts it to the screen
names.each do |name|
puts name
end
output:
bob
susan
$(document).ready(function(){
$('body').fadeIn(1000) {
}
})
describe "array = [1,2,3,4,5]" do
it "should make a new array of numbers" do
array = [1,2,3,4,5]
expect(array).to eq [1,2,3,4,5]
end
end
Showing C:/Sites/rails_studio/flix/app/views/movies/index.html.erb where line #16 raised:
undefined method `>' for nil:NilClass
<td><%= time_ago_in_words(movie.released_on) %> ago</td>
allergens = {
"eggs" => 1,
"peanuts" => 2 ,
"shellfish" => 4,
"strawberries" => 8,
"tomatoes" => 16,
"chocolate" => 32,
"pollen" => 64,
"cats" => 128,
}
require 'sqlite3'
#Open the SQLite3 Database
@db = SQLite3::Database.open "data.db"
#Getting information to create a bot with
def start
puts "Enter a Bots name:"
@name = gets.chomp
@iheartkode
iheartkode / sitemap.xml
Created May 20, 2014 02:17
Non plugin Sitemap
---
layout: nil
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for post in site.posts %}
<url>
<loc>{{ site.baseurl }}{{ post.url }}</loc>
{% if post.lastmod == null %}
<lastmod>{{ post.date | date_to_xmlschema }}</lastmod>