Skip to content

Instantly share code, notes, and snippets.

@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">
@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);
module Jekyll
class PjaxFile
def initialize(site, base, dir, obj)
@output = obj.output
@base = base
@dir = dir
@url = obj.url
module Jekyll
class PjaxPage < Page
def initialize(site, base, dir, page)
@site = site
@base = base
@dir = dir
@name = page.name
<!DOCTYPE html>
<html>
<head>
<title>Checkbox</title>
<style>
input[type=checkbox] {
display:none;
}
@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.

@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 {
package main
import (
"fmt"
"math"
)
type ErrNegativeSqrt struct {
Num float64
}
package main
import (
"code.google.com/p/go-tour/pic"
)
func Pic(dx, dy int) [][]uint8 {
result := make([][]uint8, dy)
for x := 0; x < dy; x++ {
@meirish
meirish / gist:3030572
Created July 2, 2012 02:28
instagram's inlined js
<script>
// SETUP
is_logged_in = false
myUsername = "";
myProfilePicURL = "#";