Skip to content

Instantly share code, notes, and snippets.

@bazub
bazub / stars.php
Created November 7, 2012 14:46
Star rating system using PHP/HTML/CSS
<html>
<style type="text/css">
.starRate {position:relative; margin:20px; overflow:hidden; zoom:1;}
.starRate ul {width:160px; margin:0; padding:0;}
.starRate li {display:inline; list-style:none;}
.starRate a, .starRate b {background:url(star_rate.gif) left top repeat-x;}
.starRate a {float:right; margin:0 80px 0 -144px; width:80px; height:16px; background-position:left 16px; color:#000; text-decoration:none;}
.starRate a:hover {background-position:left -32px;}
.starRate b {position:absolute; z-index:-1; width:80px; height:16px; background-position:left -16px;}
.starRate div b {left:0px; bottom:0px; background-position:left top;}
@bazub
bazub / gist:4247344
Created December 9, 2012 22:49
Pseudo-code for searching for end-point of ship
Get Start_point(x,y)
if x-3 >=1
mark endpoint (x-3,y) //north
if x+3 <=10
mark endpoint (x+3,y) //south
if y-3 >=1
mark endpoint (x,y-3) //west
if y+3 <=10
mark endpoint (x,y+3) //east
update map