Skip to content

Instantly share code, notes, and snippets.

View dsignr's full-sized avatar

Neya dsignr

View GitHub Profile

Deploying Elixir and Phoenix applications using Docker and Exrm

Goal

By the end of this quick guide, you will know how to compile a Phoenix app release using Exrm and run it inside a Docker container. I've found only a couple of articles that discuss getting an Elixir app up and running inside a Docker container, and even those only touched on some parts of the process. The idea is that this guide will give you a full end-to-end example of how to get all the pieces and parts working together so that you are able to deploy your Phoenix application inside a Docker container.

Assumptions

  1. You already have a working Elixir environment with the Phoenix Framework installed
  2. You have at least basic working knowledge of Docker, and have installed the Docker tools onto your local environment

Why I hate TypeScript

Warning: These views are highly oppinated and might have some slightly incorrect facts. My experience with typescript was about 2 weeks in Node and a week in angular2.

Not Standard

TypeScript is implementing their own take on JavaScript. Some of the things they are writing will likely never make it in an official ES* spec either.

Technologies that have competing spec / community driven development have a history of failing; take: Flash, SilverLight, CoffeeScript, the list goes on. If you have a large code base, picking TypeScript is something your going to be living with for a long time. I can take a bet in 3 years JavaScript will still be around without a doubt.

Its also worth noting that they have built some things like module system and as soon as the spec came out they ditched it and started using that. Have fun updating!

@rakuishi
rakuishi / analytics.rb
Created February 18, 2016 06:28
Google Analytics API Client with ruby
# 参考
# * https://developers.google.com/google-apps/calendar/quickstart/ruby
# * https://github.com/google/google-api-ruby-client/blob/master/samples/cli/lib/samples/analytics.rb
# * https://gist.github.com/rakuishi/5010ee819260cdd32a15
# $ gem install google-api-client
require 'googleauth'
require 'googleauth/stores/file_token_store'
require 'google/apis/analytics_v3'
require 'fileutils'
@mattweldon
mattweldon / up-and-running-with-edeliver-on-do.md
Last active September 3, 2021 16:48
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new droplet
  • London
  • Ubuntu
  • No apps
  • Add SSH keys
@psema4
psema4 / datauri-generator.js
Created August 21, 2015 02:15
Generate Data URI's on the fly
// SOURCE: http://davidwalsh.name/convert-image-data-uri-javascript
function getDataUri(url, callback) {
var image = new Image();
image.onload = function () {
var canvas = document.createElement('canvas');
canvas.width = this.naturalWidth; // or 'width' if you want a special/scaled size
canvas.height = this.naturalHeight; // or 'height' if you want a special/scaled size
@kengz
kengz / Deploying NodeJS App on Google Cloud Platform
Last active December 8, 2019 18:56
Deploying NodeJS App on Google Cloud Platform
# Deploying NodeJS App on Google Cloud Platform
`authored Jul 3 2015 by kengz`
## Installation
- Account with Google Cloud Platform.
- Install [Google Cloud Platform SDK](https://cloud.google.com/sdk/) to use `cloud` in the terminal.
- Install [Docker](https://cloud.google.com/tutorials/install-docker) for the VM container.
- Locally, login for the first time: `gcloud auth login`
@anchetaWern
anchetaWern / speech-recognition.js
Created May 16, 2015 09:49
speech-recognition.js
var recognition;
function startRecognition() {
recognition = new webkitSpeechRecognition();
recognition.onstart = function(event) {
updateRec();
};
recognition.onresult = function(event) {
var text = "";
for (var i = event.resultIndex; i < event.results.length; ++i) {
@thluiz
thluiz / httpoison_post_form_request.ex
Created February 1, 2015 21:51
HTTPoison post url encoded form
headers = [
{"Content-Type", "application/x-www-form-urlencoded"},
{"Accept", "text/html"}
]
encoded_text = URI.encode_www_form(text)
body = "text=#{encoded_text}"
case HTTPoison.post(url, body, headers) do
{:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
@mvirkkunen
mvirkkunen / gist:89f61a06819530e48b53
Created May 26, 2014 17:17
Tracker-ish URLs found from "Awesome Screenshot" source code
https://chrome.google.com/webstore/detail/awesome-screenshot-captur/alelhddbbhepgpmgidjdcjakblofbmce
How many trackers does a single Chrome extension need?
Seven.
https://ssl.google-analytics.com/ (manifest.json, javascripts/cga.js)
https://cdn.extensionanalytics.com/ (manifest.json, javascripts/feedback.js)
https://pixel.getpaidfordata.com/ (manifest.json, background.html)
https://tags.crwdcntrl.net/ (manifest.json)
@leecardona
leecardona / RegEx for HTTP Status Codes
Created May 4, 2014 17:25
Javascript Regular Expression for valid HTTP Status Codes
//DEFINE REGEX - valid input range is 100 thru 599
var regEx = /^[1-5][0-9][0-9]$/
//TEST REGEX
regEx.test(99)
=>false
regEx.test(100)
=>true