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
begin; | |
set local jwt.sub = '[email protected]'; | |
show jwt.sub; | |
select listing_id, listing_name, listing_desc from farmers_markets_pa; | |
-- allowed to update | |
update farmers_markets_pa set listing_desc = 'updated @ ' || current_time where listing_id = 301498 returning listing_id; | |
-- not allowed to update | |
update farmers_markets_pa set listing_desc = 'updated @ ' || current_time where listing_id = 300430 returning listing_id; | |
select listing_id, listing_name, listing_desc from farmers_markets_pa; |
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
azsub() { | |
az account set --subscription $(az account list --all --query '[].[id, name]' --out tsv | fzf | awk '{print $1}') | |
} |
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
# Get editor completions based on the config schema | |
"$schema" = 'https://starship.rs/config-schema.json' | |
palette = 'osx' | |
format = """ | |
[](bold green)\ | |
$os\ | |
$username\ | |
$directory\ |
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
const { EventHubProducerClient } = require("@azure/event-hubs") | |
const { chunkPromise, PromiseFlavor } = require('chunk-promise') | |
var now = require("performance-now") | |
var sp = require('streaming-percentiles') | |
var epsilon = 0.1; | |
var g = new sp.GK(epsilon); | |
const TestCases = require("../events/test_cases.js") | |
const impression = TestCases[0].expected.outputClientImpressionMessage[0] |
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
job = (input, batchNumber) => { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
console.log('Running batch ',batchNumber, 'processing ', input) | |
resolve('completed ' + input) | |
}, 1000) | |
}) | |
} | |
async function batcher(inputArray, fn, batchSize) { |
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
/** some examples for using and testing sprocs | |
Needs the key in the env var: export cosmos_key="q2Mk..... | |
npm i -s @azure/cosmos | |
npm i -s uuid | |
runHello will create a simple sproc, update it to the collection, and then test it | |
runSprocCase will create a sproc that does a server-side update for atomic updates, pushes it to the collection, tests it |
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
#!env bash | |
# | |
# run source ./githublink to load this | |
# | |
# cd repo | |
# gfh #opens the repo url | |
# gfh filename #opens the file | |
ghl () { | |
CLIPONLY=false |
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
const assert = require('assert') | |
function makeDeposits (deposits) { | |
return 0 | |
} | |
const deposits = [0, 100, 100, 100] | |
const expected = 300 | |
const balance = makeDeposits(deposits) |
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
const csv = require('csv') | |
const fs = require('fs') | |
const path = require('path') | |
const devnull = require('dev-null') | |
const catData = require('./catData') | |
const inputs = ['Members_49827_14.csv', 'Contacts Combined-3-Files.csv'] | |
inputs.forEach(processCSV) |
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 | |
REGION="us-east-1" | |
PROFILE="prod" | |
get_ecl_ip(){ | |
aws ec2 describe-instances \ | |
--profile $PROFILE \ | |
--filters Name=tag:Name,Values=enrollecl \ | |
--query "Reservations[].Instances[].PrivateIpAddress" \ |
NewerOlder