Skip to content

Instantly share code, notes, and snippets.

View dalyons's full-sized avatar

David Lyons dalyons

  • Chime
  • San Francisco
View GitHub Profile
Today is a big moment in Expensify history. We have become a public company and we owe the success of our business to you, our millions of loyal members who have stuck with us through the years. Every receipt scanned, every invoice sent, bill paid, card swiped, and every person to whom you recommended Expensify, propelled us one step further and now here we are, 13 years later as a public company.
I want to share with you my Founder's Letter that I wrote for the IPO which can be found in our S-1 filing. Enjoy, and thanks for your trust and confidence over the years, we will continue working our hardest to be worthy of it!
The next 100 years are going to be nuts.
Global population is going to peak, and then go down—possibly forever—inverting the labor pool. The worst effects of climate change will be felt, and (with enough effort) begin to subside. Automation will wipe out millions of jobs, potentially creating a hyper-concentration of wealth that would exacerbate social tensions around the world. VR and pe
## ~/D/c/r/r101-api ❯❯❯ cat lib/active_record/postgresql_adapter_reconnect_patch.rb ✘ 1 nplusone-phonecalls ✭ ✱ ◼
# monkey patch postgres adapter to attempt to reconnect connections that
# have been rendered dead by various means, but that activerecord doesnt know about yet.
#
# We see errors like
# ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() - cannot get socket descriptor
# ActiveRecord::StatementInvalid: PG::TRSerializationFailure: ERROR: canceling statement due to conflict with recovery DETAIL: User query might have needed to see row versions that must be removed.
#
# These seem to be caused by upstream cancellations of the connection/socket.
# Whenever you pull a connection from a pool in activerecord, it calls #active?

Keybase proof

I hereby claim:

  • I am dalyons on github.
  • I am dalyons (https://keybase.io/dalyons) on keybase.
  • I have a public key whose fingerprint is EC6C 6FEF EAB8 E5F0 A300 A33F 4398 9CEC C20F D2D3

To claim this, I am signing this object:

jonathantullett commented on Feb 9, 2015
I have discovered an issue whereby starting a process via by doing
supervisor> start procgroup:*
does not honour the autorestart settings and results in supervisor trying to restart any failed processes in that group indefinitely.
My test-case config file:
[program:test]
command=/tmp/exit-non-zero.sh
@dalyons
dalyons / gist:f184fe48b908a9f1749e
Last active August 29, 2015 14:02
gapped messages
//so this was built for a different style of API (typed objects, can choose client list object renderer based on type)
// example url: /coversation/:id/messages
[
{
type: 'application/vnd.text.message+json',
id: 123,
text: "whatevs",
seq: 1234
@dalyons
dalyons / default.vcl
Created April 29, 2012 23:41 — forked from jelder/newrelic.h
Add X-Request-Start header so we can track queue times in New Relic RPM beginning at Varnish.
C{
#include </etc/varnish/newrelic.h>
}C
sub vcl_recv {
C{
set_x_request_start(sp);
}C
@dalyons
dalyons / notification_format.json
Created February 3, 2012 03:21
notification format
POST /conversations/:id/invitations (current_user = 5)
{
{
":type": "application/vnd.playup.conversation.invitation+json",
"to": {
":self": "friend-999",
":type": "application/vnd.playup.friend+json",
":uid":
},
"details": {
@dalyons
dalyons / jruby_stanford_nlp.rb
Created January 13, 2012 09:30
bootstrapping the Stanford NLP from JRuby
require 'java'
include Java
require 'lib/stanford-parser/stanford-parser.jar'
include_class 'java.io.StringReader'
include_class 'edu.stanford.nlp.parser.lexparser.LexicalizedParser'
include_class 'edu.stanford.nlp.trees.PennTreebankLanguagePack'
module NLP
PARSER = LexicalizedParser.new('lib/stanford-parser/englishPCFG.ser.gz')
PTLP = PennTreebankLanguagePack.new
@dalyons
dalyons / gist:1441680
Created December 7, 2011 06:14
js question
Without using jQuery or other external libraries, but assuming a modern browser environment,
write some Javascript to sort the list with id players by their data-rank attribute in
ascending order:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
@dalyons
dalyons / gist:1425320
Created December 2, 2011 23:25
openssl hax needed to get a fairly standard rails3.1 app going on JRuby 1.6.x
if defined?(JRUBY_VERSION)
#Hackily implement a missing method in JRuby net library that causes:
# undefined method `read_nonblock' for #<OpenSSL::SSL::SSLSocket:0xb692bc4>
#
#See: http://jira.codehaus.org/browse/JRUBY-5529
#
#In my case, its trigger from faraday in the oauth2 gem.