This file contains hidden or 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
case "$TERM" in | |
screen*) | |
alias psql='PAGER=vim_psql_pager psql' | |
esac |
This file contains hidden or 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
-- This will return your results as json, and the first row will be a json object containing counts for field | |
-- values that can be used to build a faceted search/filter UI. | |
with t as ( | |
select * my_table where filter_field='value' -- this is your base query, everything else is based on it | |
), | |
field_counts as ( -- this gives you distinct values for your chosen fields from the result set from "t". Add more unions for more faceted fields | |
select json_agg(fc) from ( | |
select json_build_object(field, json_agg(json_build_object(val, num))) fc | |
from ( |
This file contains hidden or 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
/* Inspired by http://cpratt.co/twitter-bootstrap-callout-css-styles/ */ | |
.bs-callout { | |
padding: 20px; | |
margin: 20px 0; | |
border: 1px solid #eee; | |
border-left-width: 5px; | |
border-radius: 3px; | |
} |
This file contains hidden or 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
http://snapshot.debian.org/archive/debian/20140101T042327Z/pool/main/l/linux-2.6/linux-image-2.6.32-5-amd64_2.6.32-48squeeze4_amd64.deb |
This file contains hidden or 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($) { jQuery.fn.placeholder = function() { | |
var i = document.createElement('input'); if ('placeholder' in i) return; | |
$(this).filter('textarea').each(function(){ | |
var placeholder = $(this).attr('placeholder'); | |
$(this).html(placeholder); | |
$(this).css({color:'#999999'}); | |
$(this).bind('focus', function(){ | |
if($(this).html()==placeholder) { |
This file contains hidden or 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 save_images($object_id, $string) { | |
// This part could probably be better | |
$types = array( | |
'image/jpeg' => 'jpg', | |
'image/png' => 'png', | |
'image/gif' => 'gif', | |
); | |
$DOM = new DOMDocument; | |
$DOM->loadHTML($string); | |
// Find all the img tags |
This file contains hidden or 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: Set default values of input elements. Get the default value from associated label having class="default-value" | |
Author: Lasse Bunk ([email protected] - http://lassebunk.dk) with additions by Jay Knight (http://jk3.us/) | |
Demo: http://lassebunk.dk/demos/default-values/ | |
Version: 1.0.1 | |
License: Use as you wish :-) | |
*/ | |
Event.observe(window,"load", function(event) { | |
$$("label.default-value").each(function(label) { |
This file contains hidden or 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() { | |
// | |
// start of core hash functions | |
// | |
function b64_md5(p) { | |
return binl2b64(core_md5(str2binl(p),p.length*8)); | |
} | |
function binl2b64(binarray) { |
This file contains hidden or 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
/* | |
* emptyText extension for Scriptaculous's Ajax.InPlaceEditor. | |
* | |
* based on http://codetocustomer.com/blog/2008/06/empty-text-for-ajaxinplaceeditor | |
* with some fixes suggested in the comments and some of mine. | |
* | |
*/ | |
Ajax.InPlaceEditorWithEmptyText = Class.create(Ajax.InPlaceEditor, { |
This file contains hidden or 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
// ==UserScript== | |
// @name phpMyAdmin: Bigger SQL box | |
// @namespace http://jk3.us/gmns | |
// @description Enlarge SQL Boxes in phpMyAdmin | |
// @include http://svn2.cure4kids.net/padmin/* | |
// @include https://svn2.cure4kids.net/padmin/* | |
// @include https://www.cure4kids.org/padmin/* | |
// @exclude */querywindow.php* | |
// ==/UserScript== | |
NewerOlder