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
SELECT | |
u.*, | |
row_to_json(d.*) device | |
FROM | |
users u | |
INNER JOIN ( | |
SELECT | |
user_id, | |
MAX(created_at) MaxDate | |
FROM |
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
Bug: | |
python 2.7, pip 8.1.1, Ubuntu 16.04 | |
pip install as jenkins user throws: | |
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-eHn5Qu-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/cryptography | |
Storing debug log for failure in /root/.pip/pip.log | |
The command '/bin/sh -c cd /src; pip install -r requirements.txt' returned a non-zero code: 1 | |
Build step 'Execute shell' marked build as failure |
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 zuppler = 'c6b348e0-6d49-11ea-9d4d-db9d78913103' | |
const vendor = '05a3b881-ee42-11eb-a309-21dcd8197474' | |
const time = moment() | |
.add({ hours: 2 }) | |
.startOf('hour') | |
.toISOString() | |
//quote payload | |
const q = { | |
bag_count: 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
//note ready_at in /quotes and ready_by in /orders are the same value | |
POST /quotes | |
{ | |
origin: | |
'2000 Market Street, 2000 Market St, Philadelphia, PA 19103, USA', | |
destination: | |
'1999 North 52nd Street, , Philadelphia, PA, 19131, United States', | |
vendor_id, |
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 | |
# Scans /tests directory for instances of 'it.only', | |
# If found, cancel commit and log files that need to be fixed. | |
TEST_ERRORS=$(grep -s it.only ../tests/*/** | wc -l) | |
echo "Verifying all tests are enabled..."; | |
if [ $TEST_ERRORS -gt 0 ] | |
then |
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
import { Knex } from 'knex' | |
import { Territory } from '../packages/types' | |
exports.up = async function (knex: Knex) { | |
await knex.schema.hasTable('operators').then(async hasTable => { | |
if (hasTable) { | |
await knex.schema | |
.hasColumn('operators', 'send_tracker_link') | |
.then(async hasColumn => { | |
if (!hasColumn) { | |
await knex.schema.table('operators', t => { |
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 deriveRunnerLaborHours(pred: CapacityPreds, max_callout_rate: number) { | |
if (pred.runner_hours_predicted === 0) { | |
return { finalCapacity: 0 } | |
} | |
let predictedDrhWithLimits: number = null | |
if (pred.drh_predicted < MIN_DRH) { | |
predictedDrhWithLimits = MIN_DRH | |
} else if (pred.drh_predicted > MAX_DRH) { |
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
Applying hasura data to: | |
https://worthy-leech-90.hasura.app/v1/graphql | |
{"level":"info","msg":"Help us improve Hasura! The cli collects anonymized usage stats which\nallow us to keep improving Hasura at warp speed. To opt-out or read more,\nvisit https://hasura.io/docs/1.0/graphql/manual/guides/telemetry.html\n","time":"2021-01-13T22:34:07Z"} | |
{"level":"debug","msg":"global config file exisits, verifying contents","time":"2021-01-13T22:34:07Z"} | |
{"level":"debug","msg":"global config is pre-set to \u0026cli.GlobalConfig{UUID:\"ebb072c2-9126-4302-af5c-c1598c9ad5f9\", EnableTelemetry:true, ShowUpdateNotification:true, CLIEnvironment:\"default\"}","time":"2021-01-13T22:34:07Z"} | |
{"level":"debug","msg":"global config: uuid: ebb072c2-9126-4302-af5c-c1598c9ad5f9","time":"2021-01-13T22:34:07Z"} | |
{"level":"debug","msg":"global config: enableTelemetry: true","time":"2021-01-13T22:34:07Z"} | |
{"level":"debug","msg":"global config: showUpdateNotification: true","time":"2021 |
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 | |
apt-get -y update | |
cat > /tmp/subscript.sh << EOF | |
# START UBUNTU USERSPACE | |
echo "Setting up NodeJS Environment" | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.9/install.sh | bash | |
echo 'export NVM_DIR="/home/ubuntu/.nvm"' >> /home/ubuntu/.bashrc | |
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> /home/ubuntu/.bashrc | |
# Dot source the files to ensure that variables are available within the current shell | |
. /home/ubuntu/.nvm/nvm.sh |
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
##FILESYSTEM | |
# append all .csv files in only one and ignore headers in subsequent files. | |
#!/bin/bash | |
OutFileName="X.csv" # Fix the output name | |
i=0 # Reset a counter | |
for filename in ./*.csv; do | |
if [ "$filename" != "$OutFileName" ] ; # Avoid recursion | |
then | |
if [[ $i -eq 0 ]] ; then |
NewerOlder