Skip to content

Instantly share code, notes, and snippets.

View timer-c++03.cpp
#include <iostream>
#include <ctime>
class Timer
{
public:
Timer() { clock_gettime(CLOCK_REALTIME, &beg_); }
double elapsed() {
clock_gettime(CLOCK_REALTIME, &end_);
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<style id="jsbin-css">
body {
font-family: sans-serif;
@Ilink
Ilink / gist:5763101
Created Jun 12, 2013
fastgin patch #2
View gist:5763101
From e3e7aa2249984e409f077732ee8cd95ff656f2a5 Mon Sep 17 00:00:00 2001
From: Ian Link <Ian@Angler.(none)>
Date: Mon, 10 Jun 2013 23:19:07 -0700
Subject: [PATCH 1/3] added separate limit for fastgin memory
---
src/backend/access/gin/ginfast.c | 3 ++-
src/backend/utils/init/globals.c | 1 +
src/backend/utils/misc/guc.c | 12 ++++++++++++
src/include/miscadmin.h | 1 +
View fastgin_performance_workmem.sql
-- create and populate a table with a GIN-indexable column
-- we pre-populate it to a large size; autovacuum kicks in when more than
-- a configured proportion of the table is newly inserted, and we want to
-- model the case where that doesn't happen often
drop table gtst;
create table gtst as
select array[i,j,i*j] as a
from generate_series(1,1000) i, generate_series(1,1000) j;
@Ilink
Ilink / gist:5758629
Created Jun 11, 2013
fastgin_mem_limit
View gist:5758629
From e3e7aa2249984e409f077732ee8cd95ff656f2a5 Mon Sep 17 00:00:00 2001
From: Ian Link <Ian@Angler.(none)>
Date: Mon, 10 Jun 2013 23:19:07 -0700
Subject: [PATCH] added separate limit for fastgin memory
---
src/backend/access/gin/ginfast.c | 3 ++-
src/backend/utils/init/globals.c | 1 +
src/backend/utils/misc/guc.c | 12 ++++++++++++
src/include/miscadmin.h | 1 +
View multipass.js
window.addEventListener('load', function() {
var section = document.querySelector('div.main'),
args = document.querySelector('div.arguments'),
controls = document.querySelector('.controls'),
image = args.querySelector('img'),
video = args.querySelector('video'),
log = $('log'),
useBloomX = true,
useBloomY = true,
useBlending = true;
View multipass.js
window.addEventListener('load', function() {
var section = document.querySelector('div.main'),
args = document.querySelector('div.arguments'),
controls = document.querySelector('.controls'),
image = args.querySelector('img'),
video = args.querySelector('video'),
log = $('log'),
useBloomX = true,
useBloomY = true,
useBlending = true;
@Ilink
Ilink / rotation.js
Created Oct 25, 2012
Device Rotation Event
View rotation.js
function setup_orientation(){
function is_landscape(){
if($(window).width() >= $(window).height()){
return true;
} else {
return false;
}
}
var landscape = false;
@Ilink
Ilink / make_hsl.js
Created Oct 11, 2012
Helper to make HSL value suitable for CSS
View make_hsl.js
function make_hsl(h,s,l){
return "hsl("+h+","+s+"%,"+l+"%)";
}
@Ilink
Ilink / bind_from_json.js
Created Dec 4, 2011
Javascripts - Ian Link
View bind_from_json.js
/*------------------------------------------------------------------------------------
*
* Bind from JSON - uses JSON to set up UI bindings. Utilizes jquery's 'bind'
*
* Usage:
* Supply JSON file formatted like this:
* var json = [{
* 'selector' : '#id',
* 'bind_to' : 'click',
* 'func' : [