/* ================================================================================ Pivot example with variable number of columns in the output. ================================================================================ example data is straight forward, imagine a table with a customer identifier, an invoice date and an amount. */
CREATE OR REPLACE FUNCTION mergeArrays (a1 ANYARRAY, a2 ANYARRAY) RETURNS ANYARRAY AS $$ | |
SELECT ARRAY_AGG(x ORDER BY x) | |
FROM ( | |
SELECT DISTINCT UNNEST($1 || $2) AS x | |
) s; | |
$$ LANGUAGE SQL STRICT; |
DROP FUNCTION IF EXISTS calculate_time_range(); | |
CREATE OR REPLACE FUNCTION calculate_time_range (uom varchar, qty integer, startTs timestamptz DEFAULT (current_timestamp at time zone 'utc')::timestamptz) RETURNS tstzrange AS $$ | |
BEGIN | |
IF uom IS null THEN RETURN null; END IF; | |
IF qty IS null THEN RETURN null; END IF; | |
CASE UPPER(uom) | |
WHEN 'TIME_MS' THEN | |
RETURN TSTZRANGE(startTs, startTs + (qty || ' milliseconds')::INTERVAL, '[)'); |
SELECT
pri.lorem
, pri.ipsum
, pri.dolar orci
, pri.sit
, pri.amet
, CASE
WHEN erat = 'vitae'
THEN 'suscipit'
CREATE OR REPLACE FUNCTION pctDisplay (pct numeric, ch text = '|', length int = 20, includeLabel boolean = TRUE) RETURNS text AS $$ | |
DECLARE x TEXT; | |
BEGIN | |
IF length < 1 OR length > 100 THEN | |
length = 20; | |
END IF; | |
IF pct < 0 THEN | |
pct = 0; |
Building on the work of the +Roam bookmarklet, here is a version that allows you to capture text from webpages and articles in a few different ways:
- It will copy the text automatically. A red "copied!" pill will show in the top right of the page to let you know it worked.
- If you do not select anything it will give you only a markdown link to the page
- If you select something it will give you the selected text in italics with a markdown link to the page
- If you select more than one thing (firefox only I believe) it will give you a markdown link to the page with the selected text as child blocks nested underneath.
To try it, drag this link to your bookmarks and then select text on a page and then click the bookmark.
Building on the work of the +Roam bookmarklet, here is a version that allows you to capture text from webpages and articles in a few different ways:
- It will copy the text automatically. A red "copied!" pill will show in the top right of the page to let you know it worked.
- If you do not select anything it will give you only a markdown link to the page
- If you select something it will give you the selected text in italics with a markdown link to the page
- If you select more than one thing (firefox only I believe) it will give you a markdown link to the page with the selected text as child blocks nested underneath.
- If you select things, your selection will be restored after copying.
component { | |
variables.ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
variables.BASE = bigInt(len(ALPHABET).toString()); | |
private any function bigInt (required string input ){ | |
return createObject("java", "java.math.BigInteger").init(input); | |
} | |
private any function stringBuilder (string input = "") { |
<cfscript> | |
/* | |
this is what im actually working on, but isnt really the point of this discussion, | |
but for clarity, I have a process where I am needing to (conditionally) map | |
from one uuid to another, so I am making a litle closure to keep track. If | |
I ask for an ID that hasnt been seen yet then it just creates a new uuid for me and | |
then keeps track of it going forward. | |
*/ | |
function makeIdMapper () { |
This guide is one section of a larger guide to installing a cent 6.x server in virtual box for development purposes with different applications. The top level guide with links to all of the sections is here: https://gist.github.com/ryanguill/5149058 Some instructions in this guide may assume a configuration from other parts of the guide.
#Install Railo ColdFusion - manual installation
These instructions assume you are starting with a new VM cloned from your template
##Install httpd