Map [1]
Operation | Time Complexity |
---|---|
Access | O(log n) |
Search | O(log n) |
Insertion | O(n) for <= 32 elements, O(log n) for > 32 elements [2] |
Deletion | O(n) for <= 32 elements, O(log n) for > 32 elements |
Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create
. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.
Note that on Heroku, you must always use master
as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch
seen below (in this example, we push the local staging
branch to the master
branch on heroku.
$ git remote add staging https://git.heroku.com/staging-app.git
Deploying a Phoenix app to Fly.io is a breeze...is what everyone kept telling me. In fairness, I imagine the process would have been breezier had I just used postgres, but all the sqlite and litestream talk has been far too intriguing to ignore. "Wait", you say. "It is just a flat file. How much harder can it be?"
It is easy to make something harder than it should be. It is hard to take something complex and make it truly simple. flyctl launch
does an amazing job at providing a simple interface to the utterly complex task of generating deployment resources, especially now that we are living in a containerd
(erm, firecracker) world.
This gist is for anyone who, like me, thinks they know better than to read all of the documentation and therefore necessari
### Keybase proof | |
I hereby claim: | |
* I am copser on github. | |
* I am copser (https://keybase.io/copser) on keybase. | |
* I have a public key ASAMxtVKcEvHNiRiJdqPpEdf2QMP_IjhmG-rwZb9tkwSTgo | |
To claim this, I am signing this object: |
Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe] [dtrace] | |
Interactive Elixir (1.9.1) - press Ctrl+C to exit (type h() ENTER for help) | |
iex(1)> TwitterFeed.get_tweets("CandyCrushSaga") | |
%TwitterFeed.Feed{ | |
last_tweet_retrieved: 1204476179719294976, | |
more_tweets_exist: true, | |
tweets: [ | |
%TwitterFeed.Tweet{ | |
display_name: "Candy Crush Saga", |
/* | |
* Example implementation | |
*/ | |
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation | |
{ | |
NSLog(@"Launched with URL: %@", url.absoluteString); | |
NSDictionary *userDict = [self urlPathToDictionary:url.absoluteString]; | |
Note: Don't do this on a production evniroment!
Get the heroku database name:
heroku pg:info
Name can be found in the reponse from the command above. For example: Add-on: soaring-newly-1337
.
<html> | |
<head> | |
<style> | |
* { | |
font-family:Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; | |
} | |
</style> | |
</head> | |
<body> | |
<table cellpadding="0" cellspacing="0" class="email-wrapper" style="padding-top:32px;background-color:#ffffff;"><tbody> |
user = Repo.get!(User, user_id) |> Repo.preload(:roles) | |
role = Repo.get!(Role, role_id) | |
user_changeset = Changeset.change(user) |> Changeset.put_assoc(:roles, [role | user.roles]) |
defmodule Languafy.Web.Context do | |
@behaviour Plug | |
import Plug.Conn | |
alias Languafy.User | |
def init(opts), do: opts | |
def call(conn, _) do | |
case build_context(conn) do | |
{:ok, context} -> |