Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"math"
)
type ErrNegativeSqrt struct {
Num float64
}
@meirish
meirish / http.go
Created September 3, 2012 19:24
solution to #58 of local go tour
package main
import (
"net/http"
"fmt"
)
type String string
type Struct struct {
@meirish
meirish / README.md
Created September 29, 2012 14:59
Traditional calendar in d3.js

I based this off of the calendar example, but changed things so that segments are months (only a year shown in the example, but this could easily be tweaked) arranged in a more traditional calendar format with weeks in rows instead of columns.

<!DOCTYPE html>
<html>
<head>
<title>Checkbox</title>
<style>
input[type=checkbox] {
display:none;
}
module Jekyll
class PjaxPage < Page
def initialize(site, base, dir, page)
@site = site
@base = base
@dir = dir
@name = page.name
module Jekyll
class PjaxFile
def initialize(site, base, dir, obj)
@output = obj.output
@base = base
@dir = dir
@url = obj.url
@meirish
meirish / check.js
Last active December 11, 2015 12:39
$('div.table').on('change', 'input', function () {
var $targ = $(this),
isChecked = $(this).is(':checked'),
$checks = $('.table .checkbox input'),
$checked = $checks.filter(':checked'),
$sumlabel = $('.overview-summary label');
// the checkbox update will be handled by its own handler
// update this row
$targ.closest('.tr').toggleClass('selected', isChecked);
@meirish
meirish / index.html
Last active March 6, 2017 18:40
First attempt trying to detect amount of free space in WebSQL using a temporary db that we fill with 0's. Blog post to follow.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Yardstick Test</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<script src="./yardstick.js"></script>
<style type="text/css" media="all">
;(function (){
var HomeUI = {
imageLoadCounter:1,
delayTimer:null,
animationTimer:null,
timerCounter:0,
currentAnimation:null,
animating:false,
popUpTimer:null,
NUM_IMAGES_TO_LOAD:4,
<div class="pure-g">
<div class="pure-u-20-24 padding-r-s-mobile">
<h2 class="h3 margin-none">
{{course.title}}
</h2>
<p class="light margin-none small">
{{#t}}Next Due {{date course.next_section_due "full"}}{{/t}}
<span class="pink">({{date course.next_section_due "fromNow"}})</span>
&nbsp;/&nbsp;