$ cat data/bio/kurt-roberts.json
{"sys":{"space":{"sys":{"type":"Link","linkType":"Space","id":"----------"}},"id":"------------","type":"Entry","createdAt":"-------","updatedAt":"-------","environment":{"sys":{"id":"master","type":"Link","linkType":"Environment"}},"revision":2,"contentType":{"sys":{"type":"Link","linkType":"ContentType","id":"bio"}},"locale":"en-US"},"fields":{"name":"Kurt Roberts","title":"Chief Creative Technologist?","description":"Senior engineering and design team lead with 15+ years of experience creating solutions for high-profile brands such as Coca-Cola, BlueCross BlueShield America, General Mills and DirecTV, and powerful forces for change such as Facing History and Ourselves, The Washington Area Women's Foundation, Humane Society of the United States and Planned Parenthood.","pastClients":["Coca-Cola","BlueCross BlueShield America","General Mills","DirecTV","Facing History and Ourselves","Humane Society of the United States","Planned P
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
-- Liberally borrowed from - https://stackoverflow.com/questions/3327312/drop-all-tables-in-postgresql | |
-- If you happen to be working on a jira database, you're going to have to do it twice to resolve all the cascades | |
DO $$ DECLARE | |
r RECORD; | |
BEGIN | |
-- if the schema you operate on is not "current", you will want to | |
-- replace current_schema() in query with 'schematodeletetablesfrom' | |
-- *and* update the generate 'DROP...' accordingly. |
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
'use strict'; | |
/**** | |
Set up as a lambda function, it doesn't need any special permissions. | |
To test, you'll use a CloudFrontHTTPRedirect template. | |
Then, you'll create a CloudFront Distribution and attach this as a behavior. | |
Use the Event Type "ViewerRequest" to trigger 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
const _ = require('lodash'), | |
Bottleneck = require('bottleneck'), | |
limiter = new Bottleneck({ | |
minTime: 333, | |
maxConcurrent: 1 | |
}), | |
Promise = require('bluebird'), | |
promises = []; | |
_.range(10).forEach(function (x) { |
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 | |
tasklist="Task1 Task2" | |
Task1 () { | |
echo "task 1" | |
} | |
Task2 () { | |
echo "task 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
# using OSAScript's JavaScript support | |
osascript -l JavaScript -e "console.log(($(cat /Users/$(whoami)/Library/Application\ Support/Google/Chrome/Local\ State)).profile.info_cache.Default.user_name)" | |
# using python | |
cat /Users/$(whoami)/Library/Application\ Support/Google/Chrome/Local\ State | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["profile"]["info_cache"]["Default"]["user_name"];' |
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 | |
# Built in: | |
osascript <<EOF 2>/dev/null | |
display notification "test message" with title "title" | |
EOF | |
# yo- https://github.com/sheagcraig/yo | |
yo_scheduler -t "Title" -n "test message" |
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
# remove a string from all lines in a file | |
cat thing-groups.csv | perl -ne 's/,SmartGroup//g; print $_' - | |
# just the ones with that smartgroup, but remove it | |
cat thing-groups.csv | perl -ne 'while(/(.*),SmartGroup(.*)/g){ print "$1$2\n" };' - | |
# just the ones with that smartgroup, but make it the last one | |
cat thing-groups.csv | perl -ne 'while(/(.*)(,SmartGroup)(.*)/g){ print "$1$3$2\n" };' - |
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 puppeteer = require('puppeteer'); | |
async function getLink (url, xpathExpression) { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto(url); | |
let link = await page.$eval(xpathExpression, anchor => { return anchor.href; }); | |
await browser.close(); | |
return link; | |
}; |