Skip to content

Instantly share code, notes, and snippets.

View ssaunier's full-sized avatar

Sébastien Saunier ssaunier

View GitHub Profile
ssaunier / imdb.yml
Created March 4, 2023 09:48 — forked from dmilon/imdb.yml
Rails search lecture seeds
View imdb.yml
- title: "Superman"
year: 1978
director_slug: donner
synopsis: |
An alien orphan is sent from his dying planet to Earth,
where he grows up to become his adoptive home's first and greatest superhero.
- title: "Batman v Superman: Dawn of Justice"
year: 2016
director_slug: snyder
ssaunier /
Created March 2, 2020 14:59
Creating a Rails app with MySQL database after Le Wagon

If you graduated from Le Wagon, you know how to create a Rails Application using a PostgreSQL database.

What if you want to use MySQL instead?

You are on the right page! here is a quick tutorial on how to do it, on macOS (for Linux, MySQL setup is different, follow along this tutorial and then follow along starting with rails new [...])

brew install mysql
# For a quick start, do not put a `root` password yet.
mysql.server start
import requests
isbn = input("ISBN?")
key = f"ISBN:{isbn}"
url = ""
params = {
"bibkeys": key,
# init tableu des mains (ROCK, PAPER, SCISSORS)
# règle du jeu ?
# initialiser MAX_SCORE à 3
# initialiser score ordi à 0
# initialiser score joueur à 0
# lancer le jeu
# ordinateur fait son choix (random)
ssaunier / index.html
Created July 8, 2018 09:40
Bootstrap HTML boilerplate
View index.html
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<title>Hello, world!</title>
ssaunier / importpdb.sublime-snippet
Created July 5, 2018 15:11
Python debugger snippet for Sublime Text
View importpdb.sublime-snippet
<content><![CDATA[import pdb; pdb.set_trace()]]></content>
<description>import pdb</description>
<!-- USAGE -->
<!-- 1. Go to Tools -> New Snippet -->
ssaunier / application.scss
Last active September 24, 2022 14:03
Boilerplate CSS code for React Giphy
View application.scss
#root > div {
display: flex;
height: 100vh;
.left-scene {
flex: 0 0 60%;
position: sticky;
display: flex;
flex-direction: column;
ssaunier / user_binding.json
Created December 3, 2017 21:10
Sublime Key Bindings for using Emmet inside Babel JavaScript files. Sublime > Preferences > Key Bindings
View user_binding.json
{ "keys": ["tab"], "command": "expand_abbreviation_by_tab", "context":
{ "operand": "source.js", "operator": "equal", "match_all": true, "key": "selector" },
{ "match_all": true, "key": "selection_empty" },
{ "operator": "equal", "operand": false, "match_all": true, "key": "has_next_field" },
{ "operand": false, "operator": "equal", "match_all": true, "key": "auto_complete_visible" },
{ "match_all": true, "key": "is_abbreviation" }
ssaunier / cache.yml
Last active December 14, 2020 05:23
Speed up the AWS Elastic Beanstalk of your Rails deployment with bundle/assets caching
View cache.yml
# .ebextensions/cache.config
mode: "000755"
owner: root
group: root
content: |
set -xe
ssaunier / timeout_pub_scraper.rb
Last active November 8, 2017 17:15 — forked from Papillard/timeout_pub_scraper.rb
TimeOut best pubs scraper
View timeout_pub_scraper.rb
require "open-uri"
require "nokogiri"
url = ""
html_file = open(url)
doc = Nokogiri::HTML(html_file)".feature-item").take(12).each do |bar|
p"img")[0].attr("src") # image_url
p"h3 a")[0].text # name