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
# From https://shift.infinite.red/fast-csv-report-generation-with-postgres-in-rails-d444d9b915ab | |
# Storing here in case the original post ever goes down. | |
# concern | |
module DatabaseQueryStreaming | |
def stream_query_rows(sql_query, options="WITH CSV HEADER") | |
conn = ActiveRecord::Base.connection.raw_connection | |
conn.copy_data "COPY (#{sql_query}) TO STDOUT #{options};" do | |
while row = conn.get_copy_data |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
Mode | |
appOffline* | |
checkingAPI | |
apiOnline -> online | |
apiOffline -> checkingInternet | |
checkingInternet | |
internetOnline -> online | |
internetOffline -> offline | |
online | |
offline |
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 checkGlobalAPI = (context, event) => { | |
return new Promise((resolve, reject) => { | |
let condition = Math.round(Math.random() * 10) > 8; | |
console.log(condition); | |
if (condition) { | |
resolve(42) | |
} else { | |
reject('foo') | |
} | |
}); |
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
Search Bar* | |
Idle* | |
focused -> Active | |
Active | |
canceled -> Idle | |
typed -> Text Entry | |
Empty* |
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
class InitialMigration < ActiveRecord::Migration[5.0] | |
def change | |
enable_extension "pgcrypto" unless extension_enabled?("pgcrypto") | |
end | |
end |
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
Onboarding* | |
Idle* | |
signup -> Signup | |
Customer | |
Validate Email | |
click? -> Change Password | |
no click? -> NotVerified | |
Auth Service |
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
Login Flow | |
Unauthenticated* | |
login -> Error? | |
Authenticated | |
verified? -> Verified | |
not verified? -> Unverified | |
Verified | |
projects? -> Ready | |
no projects? Setup | |
Unverified |
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
Darcie* | |
Question* | |
try submitting -> Validate | |
No Errors* | |
Bad Input Error | |
Validate | |
valid? -> History | |
invalid? -> Bad Input 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
Client Registration | |
Unauthenticated | |
ready -> Unauthenticated | |
submit -> Authenticated | |
Authenticated |
NewerOlder