This file contains hidden or 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 wait = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
const retry = async (fn, retryCount = 3, intervalMs = 250, originalError) => { | |
if (retryCount === 0) { | |
if (!originalError) throw new Error('Failed after 3 retries'); | |
throw originalError; | |
} | |
try { | |
const res = fn(); | |
if (res && typeof res.catch === 'function') { |
This file contains hidden or 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
var collection = 'accounts'; | |
var bulk = db[collection].initializeUnorderedBulkOp(); | |
db[collection].find({}).forEach(row => { | |
const createdAt = dateFromObjectId(row._id); | |
bulk.find({ _id: ObjectID(row._id) }).updateOne({ $set: { createdAt } }) | |
}) | |
bulk.execute() |
This file contains hidden or 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
['get', 'post', 'put', 'delete'].forEach((method) => { | |
const originalFn = app[method]; | |
app[method] = function fn(...args) { | |
const routeFn = args[args.length - 1]; | |
const firstArgs = args.slice(0, args.length - 1); | |
const newRouteFn = (req, res, next) => { | |
try { | |
if (routeFn.constructor.name === 'AsyncFunction') { | |
return routeFn(req, res, next).catch(next); | |
} |
This file contains hidden or 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
::-webkit-scrollbar { | |
width: 2px; | |
background-color: rgba(255,255,255,0.3); | |
} | |
::-webkit-scrollbar-thumb:vertical { | |
background: rgba(255,255,255,0.4); | |
} |
This file contains hidden or 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
.swal-overlay--show-modal, | |
.swal-modal { | |
animation: none !important; | |
} |
This file contains hidden or 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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
function Loading({ size, fullScreen, isGold }) { | |
const style = { | |
borderWidth: `${size / 10}px`, | |
width: `${size}px`, | |
height: `${size}px`, | |
}; | |
if (fullScreen) { |
This file contains hidden or 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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
function Loading({ size, fullScreen, isGold }) { | |
const style = { | |
borderWidth: `${size / 10}px`, | |
width: `${size}px`, | |
height: `${size}px`, | |
}; | |
if (fullScreen) { |
This file contains hidden or 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 React, { PureComponent } from 'react'; | |
import PropTypes from 'prop-types'; | |
import Loading from '../Loading'; | |
export default class Image extends PureComponent { | |
static loadedSrcs = new Set(); | |
constructor(props, context) { | |
super(props, context); | |
this.state = { isLoaded: false, isLoading: false, error: null }; |
This file contains hidden or 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
brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered! | |
brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it. | |
brew install elixir | |
mix local.hex | |
createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw... | |
# Install the latest Phoenix. It will give us the command `mix phoenix.new` | |
mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez |
This file contains hidden or 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
private static class Vertex { | |
private int uniqueLabel; | |
public Vertex(int uniqueLabel) { | |
super(); | |
this.uniqueLabel = uniqueLabel; | |
} | |
@Override | |
public boolean equals(Object obj) { |