Find minimum in array of things:
$ cat gitlab.json | jq '.locationFactors | min_by(.locationFactor)'
Sort by value, reverse:
$ cat gitlab.json | jq '.locationFactors | sort_by(.locationFactor) | reverse
#!/usr/bin/env bash | |
set -xeuo pipefail | |
# Docker use is only as an example, this is just to demonstrate cleanup | |
function cleanup() | |
{ | |
echo "Removing containers..." | |
docker rm -f echo | |
} |
#!/usr/bin/env bash | |
# | |
### | |
# Creates a stacked set of upgrade branches from outdated npm modules | |
# - use on major version upgrades (use `npm update` for minor) | |
### | |
set -e | |
git_stuff() { |
diff --git a/packages/shared/compile-template.js b/packages/shared/compile-template.js | |
index f505702..8ace3db 100644 | |
--- a/packages/shared/compile-template.js | |
+++ b/packages/shared/compile-template.js | |
@@ -17,6 +17,18 @@ export function compileFromString(str: string) { | |
export function compileTemplate(component: Component): void { | |
if (component.template) { | |
+ if (component.template.charAt('#') === '#') { | |
+ var el = document.querySelector(component.template); |
Find minimum in array of things:
$ cat gitlab.json | jq '.locationFactors | min_by(.locationFactor)'
Sort by value, reverse:
$ cat gitlab.json | jq '.locationFactors | sort_by(.locationFactor) | reverse
//(0b001 << 0b010).toString(2) | |
const isBuilding = 0b001; | |
const hasFinished = 0b010; | |
const hasFailed = 0b100; | |
let combinedBuildState = 0b000; | |
combinedBuildState = combinedBuildState | isBuilding; |
const callApi = () => { | |
const response = fetch(...); | |
// do stuff with response | |
return response; | |
} | |
try { |
yarn list --json | jq '.data.trees[] | select(.name | contains("caniuse-lite"))' | |
cat charts.json | jq -r '.data[].attributes | [.name, .home, .description] | @csv' | sed 's/"//g' | awk -F, '{ printf "\n%s (%s)\n%s\n",$1,$2,$3}' |
const df = require('date-fns'); | |
const today = Date.now(); | |
const tomorrow = df.addDays(today, 1); | |
function getWorkDaysInMonth(day) { | |
return df.eachDay(df.startOfMonth(day), df.endOfMonth(day)) | |
.filter(date => !df.isWeekend(date)) | |
.map(date => df.format(date, 'ddd Do')); | |
} |
const Docker = require('dockerode'); | |
const fs = require('fs'); | |
const socket = process.env.DOCKER_SOCKET || '/var/run/docker.sock'; | |
const stats = fs.statSync(socket); | |
if (!stats.isSocket()) { | |
throw new Error('Are you sure the docker is running?'); | |
} |
tap "bazelbuild/tap" | |
tap "codekitchen/dinghy" | |
tap "datawire/blackbird" | |
tap "homebrew/bundle" | |
tap "homebrew/cask" | |
tap "homebrew/cask-fonts" | |
tap "homebrew/cask-versions" | |
tap "homebrew/core" | |
cask "osxfuse" | |
brew "automake" |