Skip to content

Instantly share code, notes, and snippets.

View Ilink's full-sized avatar

Ian Link Ilink

  • Splunk
  • San Francisco
View GitHub Profile
@Ilink
Ilink / gist:5763101
Created June 12, 2013 05:55
fastgin patch #2
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 +
-- 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 June 11, 2013 17:01
fastgin_mem_limit
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 +
@Ilink
Ilink / multipass.js
Created November 21, 2012 15:37 — forked from philogb/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 / multipass.js
Created November 17, 2012 00:29 — forked from philogb/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 October 25, 2012 18:07
Device Rotation Event
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 October 11, 2012 06:47
Helper to make HSL value suitable for CSS
function make_hsl(h,s,l){
return "hsl("+h+","+s+"%,"+l+"%)";
}
@Ilink
Ilink / bind_from_json.js
Created December 4, 2011 07:16
Javascripts - Ian Link
/*------------------------------------------------------------------------------------
*
* 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' : [
#include <iostream>
#include <ctime>
class Timer
{
public:
Timer() { clock_gettime(CLOCK_REALTIME, &beg_); }
double elapsed() {
clock_gettime(CLOCK_REALTIME, &end_);
<!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;