Skip to content

Instantly share code, notes, and snippets.

View p5150j's full-sized avatar
🎯
Focusing

Patrick p5150j

🎯
Focusing
View GitHub Profile
@p5150j
p5150j / geo_console.js
Created August 29, 2011 18:36
Geo Javascript
<!DOCTYPE html>
<html lang="en">
<head>
<title>Geolocation</title>
</head>
<body>
<script>
function get_location() {
@p5150j
p5150j / install
Created September 7, 2011 18:46
fresh ruby on rails app
install homebrew
sudo mkdir /usr/local
sudo chown -R $USER /usr/local
curl -Lsf http://github.com/mxcl/homebrew/tarball/master | tar xvz -C /usr/local —strip 1
install git
@p5150j
p5150j / HTML
Created September 7, 2011 18:54
jqueryxml-html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="all" href="style.css" />
<script type="text/javascript" src="jquery.js"></script>
<title>Reading XML </title>
</head>
<body>
@p5150j
p5150j / javascript
Created September 7, 2011 18:55
ajax xml
<script>
$(document).ready(function(){
$.ajax({
type: "GET",
url: "sites.xml",
dataType: "xml",
success: function(xml) {
$(xml).find('site').each(function(){
var id = $(this).attr('id');
var title = $(this).find('title').text();
@p5150j
p5150j / sites.xml
Created September 7, 2011 18:56
sites.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<sites>
<site id="0">
<title>Travis Berry</title>
<url>http://www.travisberry.com</url>
<desc>
<brief>rockin out scripts like a BOSS</brief>
<long>...and this is the long description. See how long it is :)</long>
<meta>Denver, Colorado</meta>
</desc>
@p5150j
p5150j / scroll.js
Created November 29, 2011 14:41
scroll to any href#
$(document).ready(function() {
function filterPath(string) {
return string
.replace(/^\//,'')
.replace(/(index|default).[a-zA-Z]{3,4}$/,'')
.replace(/\/$/,'');
}
var locationPath = filterPath(location.pathname);
var scrollElem = scrollableElement('html', 'body');
@p5150j
p5150j / gist:2423990
Created April 19, 2012 20:37
Instructions for the MONSTER, LIGHTBOX Simple 4:3 Shelf Model Player: 298 x 224:
<link rel="stylesheet" type="text/css" href="http://services.biemedia.com/client_deploys/current/Clients/Simple/Columbus/css/shbz.css">
<script type="text/javascript" src="http://services.biemedia.com/client_deploys/current/Clients/Simple/Columbus/shbx.js"></script>
<script type="text/javascript">
Shadowbox.init();
</script>
@p5150j
p5150j / gist:2424087
Created April 19, 2012 20:49
the string XXXXX should be replaced with the identifier
<a href="http://services.biemedia.com/client_deploys/current/Clients/Simple/Columbus/index.html?videoEmbedCode=Columbus-XXXXX" rel="shadowbox;width=298;height=224">Click to open lightbox</a>
@p5150j
p5150j / gist:2424110
Created April 19, 2012 20:52
lightbox link
<a href="http://services.biemedia.com/client_deploys/current/Clients/Simple/Columbus/index.html?videoEmbedCode=Columbus-45454545" rel="shadowbox;width=298;height=224">Click to open lightbox</a>
@p5150j
p5150j / gist:2493831
Created April 25, 2012 21:55
html booter'
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
<div id="timeperiod1"> <div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div></div>
<div id="timeperiod2"> <div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div>
</div>
<div id="timeperiod3"> <div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="btn">yep</div><div id="btn"class="