A Pen by Tyler Peterson on CodePen.
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 node | |
// https://stackoverflow.com/questions/45854169/how-can-i-use-an-es6-import-in-node | |
// That's why this package.json says where in a module | |
// Use Bowser to interpret the agent strings | |
// Seems to give results comparable to https://developers.whatismybrowser.com/useragents/parse/#parse-useragent | |
// https://www.npmjs.com/package/bowser | |
// https://lancedikson.github.io/bowser/docs/ | |
import Bowser from "bowser" |
A Pen by Tyler Peterson on CodePen.
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
hate | |
ridiculous |
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
set the_file_name to "test.txt" | |
set the_file to alias ((path to desktop as text) & the_file_name) | |
tell application "Microsoft Outlook" | |
set new_message to make new outgoing message at mail folder "Cabinet" with properties ¬ | |
{subject:"Test Subject", content:"Here is some test content. See attached: " & the_file_name} | |
make new attachment at end of new_message with properties {file:the_file} | |
make new recipient at new_message with properties {type:to recipient type, email address:{name:"Tyler Peterson", address:"[email protected]"}} | |
make new recipient at beginning of new_message with properties {type:cc recipient type, email address:{name:"CC Tyler", address:"[email protected]"}} | |
make new recipient at beginning of new_message with properties {type:bcc recipient type, email address:{name:"BCC Tyler", address:"[email protected]"}} | |
end tell |
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 node | |
// Be sure to chmod +x this file if you want to run it by name | |
// Node requires | |
var util = require('util'); | |
// Vendor requires | |
var request = require('superagent'); | |
var debug = require('debug')('blueprint-maint'); |
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/local/env node | |
new Buffer('payload').toString('base64'); // 'cGF5bG9hZA==' | |
new Buffer('cGF5bG9hZA==', 'base64').toString('ascii'); // 'payload' |
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 -eux -o pipefail | |
#set -eux | |
indent() { | |
echo "status? $?" | |
sed -e 's/^/ /' | |
} | |
#[ -f "./deploy" ] && ( set -o pipefail; ./deploy | indent ) && exit 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
//Problem : Giga Ball | |
//Language : Javascript | |
//Compiled Using : V8 | |
//Version : Node 0.10.25 | |
//Input for your program will be provided from STDIN | |
//Print out all output from your program to STDOUT | |
/** | |
* My unpolished solution to the Giga Ball question from the Bloomberg coding challenge at JSConf 2014. | |
* ~Tyler |
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 formula assumes that the date is stored in A1 | |
=QUOTIENT(DATEDIF(DATE(YEAR(A1 - WEEKDAY(A1,3)+3),1,1)-WEEKDAY(DATE(YEAR(A1-WEEKDAY(A1,3)+3),1,1),3),A1,"D"),7)+IF(WEEKDAY(DATE(YEAR(A1 - WEEKDAY(A1,3) + 3),1,1),2)>4,0,1) | |
-- Another, commented version of the formula: | |
-- The key trick of this formula is using thursday of the week the date falls in to determine which | |
-- ISO year we will fall into. Many thanks to Jürgen Schell for this idea: | |
-- http://www.j-schell.de/applescript_calendar_weeks_iso |