/* ================================================================================ 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. */ DROP TABLE IF EXISTS invoice;
#!/bin/bash | |
# Check for -debug flag | |
if [[ $* == *-debug* ]]; then | |
set -x | |
fi | |
# If we have a .taskenv file load it as source | |
if [ -f .taskenv ]; then | |
# shellcheck disable=SC1091 |
package query_builder | |
import ( | |
"strings" | |
"strconv" | |
"html/template" | |
"fmt" | |
) | |
type DynamicQueryBuilder string |
DROP FUNCTION _BASE64_UUID(VARCHAR); | |
CREATE OR REPLACE FUNCTION _BASE64_UUID(INPUT VARCHAR) | |
RETURNS varchar | |
LANGUAGE javascript | |
strict | |
AS | |
$$ | |
try { | |
var stmt = snowflake.createStatement({ | |
sqlText: `SELECT TO_VARCHAR(TRY_BASE64_DECODE_BINARY(?), 'HEX');`, |
/* Ultra lightweight Github REST Client */ | |
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
const token = 'github-token-here' | |
const githubClient = generateAPI('https://api.github.com', { | |
headers: { | |
'User-Agent': 'xyz', | |
'Authorization': `bearer ${token}` | |
} | |
}) |
/** | |
* | |
* Javascript string pad | |
* http://www.webtoolkit.info/ | |
* | |
**/ | |
var STR_PAD_LEFT = 1; | |
var STR_PAD_RIGHT = 2; | |
var STR_PAD_BOTH = 3; |
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/base64" | |
"errors" | |
"io" | |
"log" |
This section explains how to deploy a Docker Registry either privately for your own company or publicly for other users. For example, your company may require a private registry to support your continuous integration (CI) system as it builds new releases or test servers. Alternatively, your company may have a large number of products or services with images you wish to serve in a branded manner.
Docker's public registry maintains a default registry image to assist you in the deployment process. This registry image is sufficient for running local tests but is insufficient for production. For production you should configure and build your own custom registry image from the docker/distribution code.
Note: The examples on this page were written and tested using Ubuntu 14.04. If you are running Docker in a different OS, you may need to "translate" the commands to meet the requirements of your own environment.
###Simple example with the official image In this section, you cre
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"io" |
-- When SQLite is compiled with the JSON1 extensions it provides builtin tools | |
-- for manipulating JSON data stored in the database. | |
-- This is a gist showing SQLite return query data as a JSON object. | |
-- https://www.sqlite.org/json1.html | |
-- An example table with some data | |
CREATE TABLE users ( | |
id INTEGER PRIMARY KEY NOT NULL, | |
full_name TEXT NOT NULL, | |
email TEXT NOT NULL, |