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
.
stages: | |
- prepare | |
- test | |
- build | |
- deploy | |
before_script: | |
- sudo git clean -ffdx | |
# prepare env |
""" | |
Django ORM Optimization Tips | |
Caveats: | |
* Only use optimizations that obfuscate the code if you need to. | |
* Not all of these tips are hard and fast rules. | |
* Use your judgement to determine what improvements are appropriate for your code. | |
""" | |
# --------------------------------------------------------------------------- |
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} -> |
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]) |
<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> |
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
.
/* | |
* 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]; | |
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", |
### 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: |
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