Skip to content

Instantly share code, notes, and snippets.

View rafaelfess's full-sized avatar
🐼
I may be slow to respond.

Rafael rafaelfess

🐼
I may be slow to respond.
View GitHub Profile
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@daltonjorge
daltonjorge / rails_annotations.md
Created August 8, 2012 14:42 — forked from hakagura/rails_annotations.md
Explicações de conceitos do Rails e outras infos úteis.

Active Record

É um design pattern que o Rails implementa a partir da gem ActiveRecord.

Serve para conectar a camada Model da aplicação com tabelas do database, para assim criar um modelo de domínio persistível, onde a lógica (Model) e dados (BD) são apresentados em uma única solução.

Já persiste no BD:

obj.create
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created February 27, 2017 07:02 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@nickytonline
nickytonline / async-await-promise-all.js
Last active August 12, 2018 07:43
async/await with Promise.all
// In response to https://twitter.com/housecor/status/930108010558640128
function doubleAfter2Seconds(x) {
return new Promise(resolve => {
resolve(x * 2);
}, 2000);
}
async function addAsync(x) {
const { a, b, c } = await Promise.all([
doubleAfter2Seconds(10),
FROM agners/archlinuxarm-arm32v7
# pacman -Sy --noconfirm base-devel awk m4 git unzip perl wget ocaml opam ocaml-compiler-libs
RUN pacman -Sy --noconfirm base-devel awk m4 git unzip perl wget
RUN curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh | sh
RUN useradd -m esy-user
USER esy-user
@rochacbruno
rochacbruno / README.md
Last active May 12, 2024 12:02
Vim Configs and CheatSheet

VIM CheatSheet

Based on configuration provided in .config/nvim/init.vim

Glossary

  • L = Leader Key, mapped to a single space " "
  • C = Control
  • S = Shift
@laytan
laytan / main.odin
Last active October 16, 2024 21:07
UUIDV4 in Odin
package uuid4
import "core:crypto"
import "core:io"
import "core:mem"
UUID_SIZE :: 16
UUID4 :: distinct [UUID_SIZE]byte
generate :: proc() -> (u: UUID4) #no_bounds_check {
@plicjo
plicjo / simple_s3_upload.ex
Last active August 5, 2024 15:21
LiveView Uploads to S3
defmodule SimpleS3Upload do
@moduledoc """
Dependency-free S3 Form Upload using HTTP POST sigv4
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html
"""
@doc """
Signs a form upload.
The configuration is a map which must contain the following keys:
* `:region` - The AWS region, such as "us-east-1"