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
# A basic .muttrc for use with Gmail | |
# Change the following six lines to match your Gmail account details | |
set imap_user = "shreesh@kayak.com" | |
set copy=yes | |
set smtp_url = "smtps://shreesh@kayak.com@smtp.gmail.com:465/" | |
set from = "shreesh@kayak.com" | |
set realname = "shreesh ayachit" | |
# Change the following line to a different editor you prefer. |
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 subprocess | |
import re | |
# Grab password from macOS keychain | |
def grab_gh_password(): | |
invocation = ['security', 'find-internet-password', '-gs', 'github.com'] | |
block = subprocess.Popen(invocation, stdout = subprocess.PIPE, stderr = subprocess.PIPE) | |
lastline = block.stderr.read().strip().decode("utf-8") | |
parsed_password = re.sub('password: "(.*)"', '\\1', lastline) | |
return parsed_password |
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
#!/usr/bin/env bash | |
# FILE: timo-make.sh | |
# readline for facilitating | |
set -euo pipefail | |
############################################################ | |
#{{{ Helpers | |
tmuxdims () | |
{ | |
local WINDEX=${1:-$(tmux display-message -p '#I')}; | |
tmux list-windows | \grep -i "^${WINDEX}" | cut -f 3- -d'[' | sed 's/layout //' | sed 's/ @.*//' | sed 's/.$//' |
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
# https://bashrules.blogspot.com/2006/04/bash-order-of-expansions.html | |
# http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_04.html | |
alias bashexpandorder='echo '\'' | |
1. {} brace | |
2. ~ tilde | |
3. $VAR parameter & variable | |
4. $() command-substitution | |
5. $(()) arithmetic expansion | |
6. (IFS) word-splitting | |
7. * ? [ filename expansion (-f will disable) |
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
typify-file () | |
{ | |
opwd="$PWD"; | |
type -a "$1"; | |
cmdpath=$(type -P "$1"); | |
if ( test -e "$cmdpath" ); then | |
count=0; | |
while ( test -L "$cmdpath" ); do | |
(( count++ )); | |
linkrelative=$(readlink -n "$cmdpath"); |
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 | |
unset PASSWORD | |
unset CHARCOUNT | |
echo -n "Enter password: " | |
stty -echo | |
CHARCOUNT=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
# This function avoids having to: | |
# - vim into the right file | |
# - write out the alias syntax | |
# - quote a commandline's embedded quotes, which can get rather gnarly | |
# - reformat from line-squashing | |
# - add negative numbers (will auto-convert) | |
# TODO: Bug with aliasing THIS line: sed 's/\ -/ \\\n\t\-/g' | |
function aliaslast() { | |
#APPEND_LOCATION=~/.bp_local | |
if [[ -f ~/dotfiles/frags/bp_scratch ]]; 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
export async function uploadFileToS3(part, projectNumber, partNumber, attachmentBool, failureHandler) { | |
try { | |
// send http request to file-handler server | |
var requestResult = await uploadFileToS3Request(part, projectNumber, partNumber, attachmentBool) | |
// return the response of file-handler upload | |
return parseUploadFileToS3Response(requestResult) | |
} catch(error) { | |
failureHandler(part, projectNumber, partNumber, attachmentBool, requestResult, error) | |
} |
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
// does not work because-hoisting.js | |
function calculateWinnerRecursion(squares, possibleWinConditions) { | |
if (noMorePossibleWinConditions()) { return null } | |
if (winConditionIsMet()) { return theWinner() } | |
return SELF(squares, possibleWinConditions.shift())) |
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 WSE_FILE = './.wsaddress' | |
const fs = require('fs') | |
// https://stackoverflow.com/questions/12871740/how-to-detach-a-spawned-child-process-in-a-node-js-script | |
// https://github.com/puppeteer/puppeteer/issues/4061 | |
const LAUNCH_CONFIG = { | |
headless: false, | |
// handleSIGHUP: false, | |
// handleSIGINT: false, | |
// handleSIGTERM: false, | |
// args: dontBackgroundArgs |
OlderNewer