/* ================================================================================ 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. */
This file contains 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
#!/bin/bash | |
# exit if any pipeline exits non-zero | |
set -e | |
# capture stdout and stderr | |
exec 2>&1 | |
if [[ "$CONTAINER_SHUTDOWN_CLEANUP_ENABLE" = true || "$CONTAINER_SHUTDOWN_CLEANUP_ENABLE" = 1 ]]; then | |
echo "Feature: Enabling shutdown cleanup against ${CONTAINER_SHUTDOWN_CLEANUP_URL:=http://localhost:3000/your/route/to/check/ok_to_shutdown}" |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head><title>SOUND</title></head> | |
<body> | |
<div>Frequence: <span id="frequency"></span></div> | |
<script type="text/javascript"> | |
var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); | |
var oscillatorNode = audioCtx.createOscillator(); | |
var gainNode = audioCtx.createGain(); |
SELECT
pri.lorem
, pri.ipsum
, pri.dolar orci
, pri.sit
, pri.amet
, CASE
WHEN erat = 'vitae'
THEN 'suscipit'
This file contains 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
// Lazy (=on-demand) zip() | |
for (const [i, x] of zip(naturalNumbers(), naturalNumbers())) { | |
console.log(i, x); | |
if (i >= 2) break; | |
} | |
// Output: | |
// 0 0 | |
// 1 1 | |
// 2 2 |
This file contains 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
var queryParams = window.location.search.substr(1).split('&').reduce(function (qs, query) { | |
var chunks = query.split('='); | |
var key = chunks[0]; | |
var value = decodeURIComponent(chunks[1] || ''); | |
var valueLower = value.trim().toLowerCase(); | |
if (valueLower === 'true' || value === 'false') { | |
value = Boolean(value); | |
} else if (!isNaN(Number(value))) { | |
value = Number(value); | |
} |
This file contains 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
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; |
This file contains 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 param (name, type) { | |
return {name: name, type: type}; | |
} | |
function sql (template) { | |
//this line goes away entirely with the ...spread operator, the function becomes `sql (template, ...values)` | |
var values = Array.prototype.slice.call(arguments, 1); | |
//console.log("template", template); |
This file contains 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
{ | |
"A": "Alfa", | |
"B": "Bravo", | |
"C": "Charlie", | |
"D": "Delta", | |
"E": "Echo", | |
"F": "Foxtrot", | |
"G": "Golf", | |
"H": "Hotel", | |
"I": "India", |
388 Dove Valley Road, Collierville, TN 38017
(901) 257-9264 / [email protected]
I have close to 20 years of professional software development experience designing, developing and maintaining applications across a wide range of systems for both small businesses and international corporations. Programming is my passion and my hobby and I am grateful to be able to do it full time. I specialize in developing complete system solutions, working with business experts and peers to deliver quality, maintainable software. I have a never-ending desire to grow, both learning new technologies and skills and expanding my business experience.
NewerOlder