TLDR: Use for...of
instead of forEach()
in asynchronous code.
For legacy browsers, use for...i
or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
use futures::{ | |
task::{waker_ref, ArcWake}, // to create `context` from type implements ArcWake trait | |
FutureExt, // to use `Future::boxed` method | |
}; | |
use std::{ | |
future::Future, | |
sync::Arc, | |
task::{Context, Poll}, | |
}; |
# create/update resources | |
kubectl --context=minikube apply -f ./postgres.yaml | |
# In order for the service to reach the statefulset, the following should | |
# be true: | |
# statefulset.spec.selector.matchLabels.app == service.spec.selector.app | |
# statefulset.spec.selector.matchLabels.role == service.spec.selector.role | |
# give the server some time to start up | |
# ... |
use std::ops::Deref; | |
use rocket::http::Status; | |
use rocket::request::{self, FromRequest}; | |
use rocket::{Request, State, Outcome}; | |
use r2d2; | |
use r2d2_diesel::ConnectionManager; | |
use diesel::mysql::MysqlConnection; |
# taken from https://www.postgresql.org/download/linux/debian/ | |
# assumes you are root | |
echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > /etc/apt/sources.list.d/pgdg.list | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - | |
apt-get update | |
yes Y | apt-get install postgresql-client-10 |
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
First, check your current config (example output in homebrew.mxcl.postgresql.plist.xml
lower down in this gist):
cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Most importantly, note the -D /usr/local/var/postgres
argument.
Second, shut down your current PostgreSQL.
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
#property copyright "erdeszt" | |
#property version "1.00" | |
#property library | |
#include <Object.mqh> | |
#include <Arrays/ArrayObj.mqh> | |
#include <Arrays/ArrayString.mqh> | |
#include <mqlcommon/Erdeszt/Map.mqh> | |
#include <mqlcommon/Erdeszt/SmartPtr.mqh> | |
#include <mqlcommon/Erdeszt/Utils.mqh> |
Strongly opinionated set of guides to quickly setup OS X Mavericks for web development. By default OS X hides stuff that normal people don't need to see. These settings are better defaults for developers.
I don't want: any sounds, annoying confirmation dialogs, hidden extensions, superflous animations, unnecessary things running like Dashboard, Notification center or Dock(Alfred/spotlight works better for me).
These are my opinions. Read this document through and pick up the good parts to your preferences.
# - Config file for the glfw package | |
# It defines the following variables | |
# GLFW_INCLUDE_DIR, the path where GLFW headers are located | |
# GLFW_LIBRARY_DIR, folder in which the GLFW library is located | |
# GLFW_LIBRARY, library to link against to use GLFW | |
set(GLFW_INCLUDE_DIR "/usr/include") | |
set(GLFW_LIBRARY_DIR "/usr/lib") | |
find_library(GLFW_LIBRARY "glfw" HINTS ${GLFW_LIBRARY_DIR}) |