Skip to content

Instantly share code, notes, and snippets.

View derekbrown's full-sized avatar
🏗️
Building.

Derek Brown derekbrown

🏗️
Building.
View GitHub Profile
@derekbrown
derekbrown / fontFeatures.swift
Created May 29, 2020 22:48
See OTF features in Swift
let features: NSArray = CTFontCopyFeatures(font!)!
print("properties = \(features)")
@derekbrown
derekbrown / sample.gql
Created May 24, 2020 00:17
Sample GQL Document
query fetchMessages($chatId: ID!) {
fetchMessages(chatId: $chatId) {
countAfter
countBefore
messages {
type
messageId
chatId
userId
user {
# Interview
## Instructions
With the given data in `transactions.json`, we need to perform the following:
1. Remove bank transfers, third-party transfers, and ATM withdrawals.
2. Remove transactions with empty merchant data.
3. Remove transactions if their merchant is in an Exeq-defined blacklist.
4. Get the merchant from the transaction.
5. Create a list of merchants whose format matches the following:
{
"transactions": [
{
"_account": "XARE85EJqKsjxLp6XR8ocg8VakrkXpTXmRdOo",
"_id": "0AZ0De04KqsreDgVwM1RSRYjyd8yXxSDQ8Zxn",
"amount": 200,
"date": "2014-07-21",
"name": "ATM Withdrawal",
"meta": {
"location": {
# app deps
sudo yum install git
sudo yum install wget
# erlang deps
sudo yum groupinstall "Development Tools"
sudo yum install ncurses-devel openssl-devel
# erlang
wget http://www.erlang.org/download/otp_src_19.2.tar.gz

Keybase proof

I hereby claim:

  • I am derekbrown on github.
  • I am derekbrown (https://keybase.io/derekbrown) on keybase.
  • I have a public key whose fingerprint is B07D 1340 26B7 1E65 E843 B6EC 43F7 A7B6 E800 D6E9

To claim this, I am signing this object:

@derekbrown
derekbrown / MessageModel.scala
Last active June 7, 2019 16:37
Reading MongoDB ObjectIDs to Strings in Play Framework with Scala & ReactiveMongo
package models
import play.api.libs.json._
import reactivemongo.bson.BSONObjectID
import play.modules.reactivemongo.json.BSONFormats._
case class Message(
_id: BSONObjectID = BSONObjectID.generate,
subject: String,
sender: String,
participants: Seq[BSONObjectID],
_____________
__,-' `-.__
_./ `-._
_/ \
/ \.
/ \_
/ \
/ |
/ |
| |
#!/bin/sh
if ! type "node" > /dev/null; then
echo " "
echo "Node not installed. Please visit http://nodejs.org to download and install the correct Node package."
exit 1
else
echo " "
echo "Node installed correctly; continuing..."
fi
@derekbrown
derekbrown / gist:1565254
Created January 5, 2012 13:28
Disable Enter in Forms
$("#form").keypress(function(e) {
if (e.which == 13) {
return false;
}
});