View fmt_currency.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fmt_currency(num){ | |
var str=parseFloat(num).toFixed(2); | |
var arr=str.split(''); | |
var out=''; | |
var char=''; | |
for(var x=0, len=arr.length;x<len;x++){ | |
if(x<=2){ | |
out=arr.pop()+out; | |
}else{ | |
char=arr.pop(); |
View Alternator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Alternator(opts){ | |
var options = { | |
activate:function(){}, | |
deactivate:function(){}, | |
elements: [], | |
active: 0 | |
}; | |
// Overwrite defaults with user options | |
for(var opt in opts) if(opts.hasOwnProperty(opt)){ |
View pager.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// global configuration, | |
$page_size = 5; // how many items per page | |
$page_start = 1; // the starting page | |
// how many numbers will be shown before and after current, including current | |
$page_range_near = 3; | |
// The number of items to paginate through, most likely the result of |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Exponential Regression Line Using numbers.js & d3.js</title> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="numbers.js"></script> | |
<style> | |
body {font: 10px sans-serif;} | |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Quartiles using numbers.js & d3.js</title> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="numbers.js"></script> | |
<style> | |
body {font: 10px sans-serif;} |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Matrix Transpose</title> | |
<script src="numbers.min.js"></script> | |
<script src="http://d3js.org/d3.v3.js"></script> | |
<style> | |
.button { | |
fill: steelBlue; |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Countdown</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
<script> | |
var Time = {}; | |
Time.second = 1000; | |
Time.minute = Time.second * 60; |
View RAINBOWlog.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var log = console.log; | |
console.log = function(str) { | |
var css = 'background: linear-gradient(to right, red, yellow, lime, aqua, blue, fuchsia, red); color: white; font-weight: bold; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;'; | |
var args = Array.prototype.slice.call(arguments); | |
args[0] = '%c' + args[0]; | |
args.splice(1,0,css); | |
return log.apply(console, args); | |
} |
View use.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r := mux.NewRouter() | |
// Single handler | |
r.HandleFunc("/form", use(http.HandlerFunc(formHandler), csrf, logging,) | |
// All handlers | |
http.Handle("/", recovery(r)) | |
// Sub-routers | |
apiMiddleware := []func(http.Handler) http.Handler{logging, apiAuth, json} |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
width: 900px; | |
padding-top:25px; |
OlderNewer