DEV Open Owl Tour w/gist.github.com as referrer
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
/*** | |
* INSTRUCTIONS | |
* 1. Change the domain in the CONFIG below to your domain. | |
* 2. Logged in as a Google Workspace admin for the domain of interest, create a new Google Sheet in the Workspace. | |
* 3. In the sheet, select the menu Extentions > Apps Scripts | |
* 4. In the script editor, add a Service (with the + in "Services") and add the "AdminDirectory" API. | |
* 5. Copy/paste this code into the CODE section | |
* 6. Save & Run the code | |
* 7. The sheet should be updated with a full inventory of your domain's email address surface area! | |
*/ |
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
Show hidden characters
{ | |
"launch": { | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "lldb", | |
"request": "attach", | |
"name": "Attach to running process", | |
"pid": "${command:pickMyProcess}" // use ${command:pickProcess} to pick other users' processes | |
}, |
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
<?php declare(strict_types=1); | |
require __DIR__ . '/../src/bootstrap.php'; | |
require_once __DIR__ . '/../src/Util/Swoole/Utils.php'; | |
use Swoole\Coroutine; | |
use SneakyStu\Util\Swoole; | |
// TODO: will this help speed up concurrency servicing (via better scheduler?) not sure if it causes new userland concurrency coding issues | |
ini_set("swoole.enable_preemptive_scheduler", "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
const headerRowI = 1; // the row with the header cols | |
const UUID_COLUMN_NAME = 'UUID' | |
const LAST_UPDATED_COLUMN_NAME = 'LAST UPDATED' | |
// ENTRY POINTS | |
// SHEET HOOK ENTRY POINTS | |
function onEdit(e) { | |
// Spreadsheet is the 'file', Sheet is the actual sheet, similar but incompatible APIs on different objects, quite the gotcha | |
var sheet = e.source.getActiveSheet(); |
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
# Markdown Quicklook plugin | |
port install qlmarkdown | |
# multiple clipboard | |
http://jumpcut.sourceforge.net | |
# don't go to sleep, sometimes | |
http://lightheadsw.com/caffeine/ |
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
is_established_customerF <- function(customer_segment, credits_purchased) { | |
print(typeof(customer_segment)) # prints only once? | |
established_customer_threshold <- 100000000 # infinitely large | |
customer_segment <- as.character(customer_segment) | |
if (customer_segment == "multiple_photographer_company") { | |
established_customer_threshold <- 3000 | |
} else if (customer_segment == "in_house_photography_department") { | |
established_customer_threshold <- 1000 | |
} else if (customer_segment == "full_time_single_re_photographer") { |
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
## DEMO of appropriate way to bin variables with a factor | |
## this is particularly useful if one wants to bin things of asymmetric widths | |
## alternative would be non-linear axis | |
library(ggplot2) | |
library(grid) | |
library(gridExtra) | |
library(data.table) | |
r <- data.table(x = rgeom(1000, .01)) |
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
chdir /opt/www/domains/tourbuzz/current | |
screen -t db 0 rake db | |
screen -t code 1 | |
chdir /opt/www/domains/tourbuzz/shared/log | |
screen -t log 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
#!/bin/zsh | |
# configure curl output format | |
echo '%{url_effective},%{time_namelookup},%{time_connect},%{time_appconnect},%{time_pretransfer},%{time_redirect},%{time_starttransfer},%{time_total}' > curltime.format | |
# configure postgres | |
echo "create table wifi_data (ssid text,url_effective text,time_namelookup numeric(9,5),time_connect numeric(9,5),time_appconnect numeric(9,5),time_pretransfer numeric(9,5),time_redirect numeric(9,5),time_starttransfer numeric(9,5),time_total numeric(9,5));" | |
echo "" | |
echo "\\\\copy wifi_data from './wifi-data.csv' DELIMITER ',' CSV HEADER" | |
echo "select ssid, count(*), avg(time_total), stddev(time_total), min(time_total), max(time_total) from wifi_data group by ssid having count(*) > 5;" |
NewerOlder