Skip to content

Instantly share code, notes, and snippets.

View magiknono's full-sized avatar

magiknono

  • Le Mans - Nantes - Paris (FRANCE)
View GitHub Profile
### Flatpak Repos
List packages on a repo :
flatpak remote-ls repon-name --user
flatpak remote-ls
Install packages :
flatpak --user install repo-name package-name io.liri.Platform
Flathub:
@NicholasJacques
NicholasJacques / Jwt_authentication_rails.markdown
Last active June 1, 2023 03:55
JWT authentication in rails using jwt gem and bcrypt

Handroll JWT Authentication for your Rails API because no on likes using Devise

The Problem:

If you’re new to building API’s with Rails you’ve probably wondered how to authenticate requests made to the API to ensure that they are coming from the correct source with correct permissions. Since API’s are stateless applications they do not have the ability to create sessions for users. (Read about how Rails Sessions work here) This creates some challenges when trying to handle authentication because the app isn’t able to remember a user’s session data from one request to the next.

The Solution:

Enter Json Web Tokens. Json Web Tokens (JWT) are a self contained authentication method designed for stateless authentication. A self contained authentication method is one that does not require any storage on the back-end to verify the authenticity of the request. All of the data necessary to authenticate the request is contained right inside the token!

What does a JWT look like?

The Complete Guide to Nested Forms in Phoenix

I recently spent some time dealing with nested forms in Phoenix. Nested forms are great when you want to create multiple database records in a single transaction and associate them with each other. I am new to Phoenix and really struggled to find any resources that helped me with my specific problem. I decided to document what I learned in the process in hopes of helping others that are new to Elixir and Phoenix.

Here is my attempt at a one stop shop to learn everything you will need to know about nested forms. If you would like to view the GitHub repo you can check it out here.

Thanks to Heartbeat and Jose for excellent blog posts on nested forms. Also shoutout to Josh for showing me some examples at Ruby

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@qsypoq
qsypoq / devise.fr.yml
Last active October 19, 2018 09:10 — forked from GRoguelon/devise.fr.yml
French translation of devise.en.yml (version: 3.5.3).
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
fr:
devise:
confirmations:
confirmed: "Votre compte a été validé."
send_instructions: "Vous allez recevoir les instructions nécessaires à la confirmation de votre compte dans quelques minutes."
send_paranoid_instructions: "Si votre e-mail existe dans notre base de données, vous allez bientôt recevoir un e-mail contenant les instructions de confirmation de votre compte."
failure:
already_authenticated: "Vous êtes déjà connecté"
@apolloclark
apolloclark / postgres cheatsheet.md
Last active March 7, 2024 13:53
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

iMac-de-Pablo:~ Jorge$ ethminer --help
Usage ethminer [OPTIONS]
Options:
Work farming mode:
-F,--farm <url> Put into mining farm mode with the work server at URL (default: http://127.0.0.1:8545)
--farm-recheck <n> Leave n ms between checks for changed work (default: 500).
--no-precompute Don't precompute the next epoch's DAG.
Ethash verify mode:
-w,--check-pow <headerHash> <seedHash> <difficulty> <nonce> Check PoW credentials for validity.
@cheeaun
cheeaun / rdrc2015.md
Last active September 15, 2016 08:49
RedDotRubyConf 2015 links & resources 😘
@ssaunier
ssaunier / install.sh
Last active June 22, 2016 21:42
Prepare Rails app for Heroku with Puma
echo "web: bundle exec puma -C config/puma.rb" > Procfile
curl -L https://gist.githubusercontent.com/ssaunier/24bc1c4db955c19e3289/raw/puma.rb > config/puma.rb
@ssaunier
ssaunier / heroku-checklist.md
Last active March 22, 2018 08:03
Heroku Checklist
  • Buy a domain and map a CNAME to your Heroku app. Use www.example.com, not example.com
  • Register to Uptime Robot and set up a monitor on your website (keeps dyno alive!)
  • Use Unicorn as the Webserver
  • Add the Heroku add-on PG Backups with automatic backups and monthly retention
  • Install NewRelic (provision the add-on and skip to the Ruby section)
  • Add SPF and DKIM records to your Mandrill account if you send email with @yourdomain.com
  • If your website uses Devise, buy a SSL certificate and set it up to get a https:// URL. Otherwise passwords are in cl