Skip to content

Instantly share code, notes, and snippets.

View cgcardona's full-sized avatar
💭
🤖

Gabriel Cardona cgcardona

💭
🤖
View GitHub Profile
$("#roundedCornersSlider").slider({
min: 1,
max: 10,
stop: function(event, ui) {
var current = $(this).val();
alert(current);
}
});
@cgcardona
cgcardona / gist:659023
Created November 1, 2010 23:01
hate for IE users
<div id="extras">
<!--[if IE]> <p><small>You should consider upgrading your browser to
<a href="http://www.mozilla.com/firefox">Firefox</a> or <a href="http://www.opera.com">Opera</a>.
</small></p> <![endif]-->
</div>
// this code works for getting the webkit border radius value
var borderRadiusValue = $("#dynamic").css("border-top-left-radius");
console.log(borderRadiusValue);
// this code doesn't work for getting the -moz-border-radius value
var borderRadiusValue = $("#dynamic").css("-moz-border-radius");
console.log(borderRadiusValue);
@cgcardona
cgcardona / Massive Ruby Case Statement
Created December 7, 2010 16:37
Massive Ruby Case Statement
def quick_note(note)
case note
when "a0"
"#{note} = 0"
when "a#0"
"#{note} = 1"
when "b0"
"#{note} = 2"
when "c1"
"#{note} = 3"
@cgcardona
cgcardona / php array into protovis api
Created December 13, 2010 04:31
making php arrays play nice with the protovis api
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Visualizing Data as a Bar Graph</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href=".css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="js/protovis-r3.2.js"></script>
<style>
*{
foreach($a_input as $element) { $term[] = '[' . $element[$pointer1] . ', ' . $element[$pointer2] . ', ' . $element[$pointer3] . '] '; }
<?php
$month1 = $a_input[0][0];
$month2 = $a_input[1][0];
$month3 = $a_input[2][0];
$month4 = $a_input[3][0];
$month5 = $a_input[4][0];
$month6 = $a_input[5][0];
$month7 = $a_input[6][0];
$month8 = $a_input[7][0];
$month9 = $a_input[8][0];
<?php
$month = array();
foreach ($a_input as $element) {$month[] = $element[0];}
$serie1 = new XYDataSet();
$serie1->addPoint(new Point("$month[0]", $a_input[0][1]));
$serie1->addPoint(new Point("$month[1]", $a_input[1][1]));
$serie1->addPoint(new Point("$month[2]", $a_input[2][1]));
$serie1->addPoint(new Point("$month[3]", $a_input[3][1]));
$serie1->addPoint(new Point("$month[4]", $a_input[4][1]));
$serie1->addPoint(new Point("$month[5]", $a_input[5][1]));
<head>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/boombox.js" type="text/javascript"></script>
</head>
<div id="boombox">
<div><span id="boomboxCounter">1</span> <span id="boomboxTrackName"></span></div>
<button id="boomboxPlayBtn" class="slick-black boombox">Play</button>
<button id="boomboxPauseBtn" class="slick-black boombox">Pause</button>
<button id="boomboxPreviousBtn" class="slick-black boombox">Previous</button>
<button id="boomboxNextBtn" class="slick-black boombox">Next</button>
<button id="boomboxVolumeDownBtn" class="slick-black boombox">Volume Down</button>
<button id="boomboxVolumeUpBtn" class="slick-black boombox">Volume Up</button>
</div>