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'; | |
const crypto = require('crypto'); | |
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters) | |
const IV_LENGTH = 16; // For AES, this is always 16 | |
function encrypt(text) { | |
let iv = crypto.randomBytes(IV_LENGTH); | |
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv); |
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
AMS1 | Amsterdam, The Netherlands | Europe | |
AMS50 | Amsterdam, The Netherlands | Europe | |
ARN1 | Stockholm, Sweden | Europe | |
ATL50 | Atlanta, Georgia | United States | |
ATL52 | Atlanta, Georgia | United States | |
BOM2 | Mumbai, India | India | |
BOM51 | Mumbai, India | India | |
CDG3 | Paris, France | Europe | |
CDG50 | Paris, France | Europe | |
DEL51 | Paris, France | Europe |
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 | |
set -e | |
gain=${3-"1"} | |
if [ "$#" -lt 2 ]; then | |
echo "Usage: $0 input.aifc output.aifc [gain=2]" | |
exit 1 | |
else |
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
... | |
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$ | |
slack[name=%(__name__)s] | |
action = %(action_with_slack_notification)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
import UIKit | |
// Returns a list of points on the convex hull in counter-clockwise order. | |
// Note: the last point in the returned list is the same as the first one. | |
// | |
// https://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain | |
// | |
func closedConvexHull(points_ : [CGPoint]) -> [CGPoint] { | |
// 2D cross product of OA and OB vectors, i.e. z-component of their 3D cross product. |
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
(function() { | |
'use strict'; | |
_.mixin({ | |
startsWith: function startsWithMixin(s1, s2) { | |
return startsOrEndsWith(_.first, s1, s2); | |
}, | |
endsWith: function endsWithMixin(s1, s2) { | |
return startsOrEndsWith(_.last, s1, s2); | |
} | |
}); |
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
@objc(Note) | |
class Note: NSManagedObject { | |
@NSManaged var content: String | |
@NSManaged var date: NSDate | |
@NSManaged var business: Business | |
@NSManaged var coldcall: ColdCall | |
@NSManaged var contact: Contact | |
} |