Skip to content

Instantly share code, notes, and snippets.

Avatar

Iwan Buetti iwan

View GitHub Profile
@mbenatti
mbenatti / up-and-running-with-edeliver-on-do.md
Created Feb 20, 2018 — forked from mattweldon/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver
View up-and-running-with-edeliver-on-do.md

Build Server

  • Go to Digital Ocean
  • Create new droplet
  • London
  • Ubuntu
  • No apps
  • Add SSH keys
@satendra02
satendra02 / app.DockerFile
Last active Aug 9, 2020
docker+rails+puma+nginx+postgres (Production ready)
View app.DockerFile
FROM ruby:2.3.1
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/app_name
RUN mkdir -p $RAILS_ROOT
# Set working directory, where the commands will be ran:
@mbenatti
mbenatti / 0-font-awesome-bootstap-phoenix.md
Last active Sep 6, 2019
Installing Bootstrap 4 + Font Awesome from NPM in Phoenix Framework using sass
View 0-font-awesome-bootstap-phoenix.md
  • Tested with Phoenix 1.3

1) Installing sass, font-awesome and bootstrap package's using Brunch

First, install the Sass, Font Awesome, bootstrap(and deps) package:

cd assets

  • npm install --save-dev sass-brunch
  • npm install --save font-awesome
@slavikdev
slavikdev / cheatsheet.md
Created Mar 16, 2017
Rails request path cheatsheet
View cheatsheet.md

Rails request path cheatsheet

Full path with query string

>>  request.url
=> "http://localhost:3000/ask-help.amp?hui=pizda"

Virtual path without query string

>>  request.path
=> "/ask-help.amp"
@hmans
hmans / elixir_phoenix_notes.md
Last active Apr 4, 2018
Notes on learning Elixir and Phoenix
View elixir_phoenix_notes.md

Notes on learning Elixir and Phoenix

Just some assorted notes I've made while digging into Phoenix, Elixir and friends. I'm coming from a strong Rails background, so many of these will refer to features from that framework.

Views / Templates

Biggest difference from Rails?

Unlike Rails, where rendering is almost always performed by a template file, the responsibility of rendering a response in Phoenix lies with a view module (that typically corresponds to the current controller module.) This view module will typically offer a whole bunch of render functions (matching different parameters, first and foremost the template name.) Templates (found in web/templates/) will directly compile into such functions.

@PieterScheffers
PieterScheffers / start_docker_registry.bash
Last active Jul 31, 2020
Start docker registry with letsencrypt certificates (Linux Ubuntu)
View start_docker_registry.bash
#!/usr/bin/env bash
# install docker
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
# install docker-compose
# https://docs.docker.com/compose/install/
# install letsencrypt
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
@spalladino
spalladino / mysql-docker.sh
Created Dec 22, 2015
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@ndelitski
ndelitski / 1.yml
Created Nov 30, 2015
drone.yml examples
View 1.yml
clone:
path: github.com/gogits/gogs
build:
image: golang:$$GO_VERSION
environment:
- TAGS="pam sqlite"
- BUILD_OS="windows linux darwin freebsd openbsd netbsd"
@datajournalism-it
datajournalism-it / province.geojson
Created Oct 31, 2015
Confini amministrativi delle province italiane
View province.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nepsilon
nepsilon / postgres-import-export-csv.md
Last active Apr 1, 2020
Importing and Exporting CSV files with PostgreSQL — First published in fullweb.io issue #19
View postgres-import-export-csv.md

Importing and exporting CSV files with PostgreSQL

Let’s see how to use PostgreSQL to import and export CSV files painlessly with the COPY command.

Import CSV into table t_words:

COPY t_words FROM '/path/to/file.csv' DELIMITER ',' CSV;

You can tell quote char with QUOTE and change delimiter with DELIMITER.

You can’t perform that action at this time.