Skip to content

Instantly share code, notes, and snippets.

@ashlynnpai
ashlynnpai / Mike-the-Frogger.markdown
Created April 26, 2014 02:52
A Pen by Ashlynn Pai.

Mike the Frogger

When you click on Mike the Frog's toggle, his friend comes out of the water. The movement animations cycle at 50 seconds.

I made this for the Treehouse student contest. The "Mike the Frog" logo is the property of Treehouse Island, Inc. and is used here under a fair use claim. The clip art of bugs, flowers and plants belongs to nicubunu.ro and was released into the public domain. I was inspired by the Frogger video game which was developed by Konami Corporation.

I got the code for the basic toggle from http://tympanus.net/codrops/2012/09/13/button-switches-with-checkboxes-and-css3-fanciness/.

A Pen by Ashlynn Pai on CodePen.

@ashlynnpai
ashlynnpai / Contact-Earth-Form.markdown
Created April 27, 2014 21:28
A Pen by Ashlynn Pai.

Contact Earth Form

I made this for the Treehouse student contest. I'm using the CSS normalize file by necolas at http://github.com/necolas/normalize.css and my own CSS files are below that one. The photos belong to NASA and are public domain (the photo number is in the alt tag). The background is Stardust at http://subtlepatterns.com/stardust/ by Atle Mo used under http://creativecommons.org/licenses/by-sa/3.0/. The two icons are from Icomoon's free pack.

A Pen by Ashlynn Pai on CodePen.

License.

@ashlynnpai
ashlynnpai / index.html
Created April 30, 2014 17:52
A Pen by Ashlynn Pai.
<!DOCTYPE html>
<html>
<head>
<title>Trailing Zeros</title>
<link href='http://fonts.googleapis.com/css?family=Oxygen' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<div class="wrapper">
<h1>Calculate the trailing zeros in a factorial</h1>

Hubble Telescope Orbits Earth

Uses CSS3.

The earth photo GPN-2000-001097 and Hubble 1990-037B are property of NASA and are in the public domain.

A Pen by Ashlynn Pai on CodePen.

License.

Astronomical clock

My clock is based on the Astronomical Clock in Prague.

Outer ring -- This is an approximation of old Czech time and show the hours until sunset, with the golden number 24 marking the time of sunset.

Main ring -- This shows the hour according to astronomical time, with noon at 0 degrees. The golden hand points to the current hour.

class Deck
attr_accessor :cards
def initialize(cards)
@cards = cards
suit = ['C', 'D', 'H', 'S']
rank = [*2..10, 'J', 'Q', 'K', 'A']
@cards = suit.product(rank).map(&:join)
end
require "geocoder"
list = [[38.0813888889,46.2930555556,0,1,1346,"Tabriz Historic Bazaar Complex"]]
def get_coordinates(list)
all_places = []
list.each do |row|
place = []
name = row[5]
class LinkedListNode
attr_accessor :value, :next_node
def initialize(value, next_node=nil)
@value = value
@next_node = next_node
end
def print_values(list_node)
if list_node
class LinkedListNode
attr_accessor :value, :next_node
def initialize(value, next_node=nil)
@value = value
@next_node = next_node
end
def print_values(list_node)
if list_node