Skip to content

Instantly share code, notes, and snippets.

@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>
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
allergens = {
"eggs" => 1,
"peanuts" => 2 ,
"shellfish" => 4,
"strawberries" => 8,
"tomatoes" => 16,
"chocolate" => 32,
"pollen" => 64,
"cats" => 128,
}
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>
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
$(document).ready(function(){
$('body').fadeIn(1000) {
}
})
@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
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 / gist:664e5bf0a366136f7c47
Created January 4, 2016 00:14
4 function calc spec
This is a practice specification of a 4-function calculator.
User Stories:
User presses number buttons
User presses operation buttons to calculate the total
User is shown the result of calculation
User can clear the display
Psuedo:
export class App extends React.Component {
render() {
return (
<div>
<RecipeForm />
<Recipes />
</div>
);
}
}