Skip to content

Instantly share code, notes, and snippets.

View elissonmichael's full-sized avatar
🚫
undefined method 'status' for nil:NilClass

Élisson Michael elissonmichael

🚫
undefined method 'status' for nil:NilClass
View GitHub Profile
@adarsh-chakraborty
adarsh-chakraborty / Host key verification failed.md
Created November 24, 2021 13:11
Fix Host key verification failed while building an app on Heroku. It usually happens when you have a github repo as dependency in your app.

Step 1

Delete the package-lock.json file from your project.

Step 2

Clear the build cache

First install the plugin:

heroku plugins:install heroku-builds
@obie
obie / _alert.haml
Created October 15, 2020 03:29
Alerts in Reactive Rails style (with Shoelace web components)
%sl-alert.popup-toast{id: id, type: type, open: false, duration: duration, closable: true}
%sl-icon{slot: "icon", name: icon}
- if title.present?
%strong= title
%br
= text
@linuxkathirvel
linuxkathirvel / postgresql-backup-using-pg_dump.md
Last active December 7, 2023 13:11
How to take backup PosgreSQL using pg_dump with crontab in Linux?

How to take backup PosgreSQL using pg_dump with crontab in Linux?

Find the pg_hba.conf file

sudo su - postgres
psql
SHOW hba_file;

Change the method to 'trust' and save the file

sudo vim /etc/postgresql/11/main/pg_hba.conf
@elissonmichael
elissonmichael / pilha_dinamica.c
Last active April 17, 2024 02:26
Estrutura de Dados - Pilha Estática vs Dinâmica & Palíndromo
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int valor;
struct No *proximo;
} No;
typedef struct {
No *topo;

essas batalhas sobre linguagens de programação sao frequententes, mas muitos ignoram que tudo vira instruções que a máquina é capaz de executar então, no inicio, a programação era complicada, com fios (isso falando de computadores modernos, da época da segunda guerra depois, com o desenvolvimento das memórias, viu-se a vantagem de tornar a programação flexivel e armazena-la na memoria (agora abundante) os computadores e os programas começaram a crescer entao eles programavam apenas em código de máquina, instruções que eram codificadas para cada processador depois veio a ideia de agrupar instrucoes semelhantes em menemonicos aparece o assembly uma instrucao em assembly pode gerar varias instrucoes de maquina diferente mov Registrador, memoria mov memoria, Registrador

@phi-lira
phi-lira / manifest.json
Last active October 28, 2021 05:10
Lightweight Pipeline package manager manifest
{
"registry": "https://staging-packages.unity.com",
"dependencies": {
"com.unity.render-pipelines.lightweight" : "2.0.0-preview"
}
}
@grimzy
grimzy / git-pull-all
Created September 15, 2017 02:15
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@sephraim
sephraim / doubles_stubs_spies_spec.rb
Last active September 15, 2023 13:21
RSpec examples #rspec
# Sample reference code for doubles/mocks, stubs, and spies in RSpec
# Taken from Kevin Skoglund's RSpec tutorial on Lynda.com
describe 'Doubles' do
it "allows stubbing methods" do
dbl = double("Chant")
allow(dbl).to receive(:hey!)
expect(dbl).to respond_to(:hey!)
end
module WillPaginate
module ActionView
def will_paginate(collection = nil, options = {})
options[:renderer] ||= BootstrapLinkRenderer
super.try :html_safe
end
class BootstrapLinkRenderer < LinkRenderer
protected
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active May 3, 2024 11:43
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages