Skip to content

Instantly share code, notes, and snippets.

View fabdbt's full-sized avatar
👊
Working

Fabien Dobat fabdbt

👊
Working
  • Paris
View GitHub Profile

Créer une base de données sous docker

Create docker instance

docker run -d -p 3303:3306 -v ~/Workspace/databases/dadb:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=admin --name dadb mariadb:10.0.38

Create and Import db

docker exec -i dadb mysql -uroot -padmin < ~/Téléchargements/mpf_demarches_administratives.sql
@satendra02
satendra02 / app.DockerFile
Last active July 12, 2024 02:39
docker+rails+puma+nginx+postgres (Production ready)
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:
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
@Nihisil
Nihisil / jail.local
Last active September 5, 2023 06:20
Send notifications to the Slack from fail2ban
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...
@joekur
joekur / html_safe.md
Last active December 11, 2023 22:57
Proper Use of `html_safe`

Proper use of html_safe

Let's look at an innocuous piece of ruby. Consider some view code showing a user's name and phone number:

"#{first_name} #{last_name} #{phone}"

Great - this is very succinct, readable, and can easily be extracted to a method in a

@fabdbt
fabdbt / .bash_aliases
Created June 12, 2015 07:06
Git - Ram bash prompt
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# Customized by Fabien Dobat - https://github.com/Apokly
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@Cylix
Cylix / intra_epitech_api_urls.md
Last active November 18, 2023 13:23
Intranet Epitech API URLs

Intra Epitech: API URLs

L'intra d'Epitech (intra.epitech.eu) possède une API assez vaste mais malheureusement non documentée. J'ai regroupé ici un certains nombres d'urls concernant cette API.

Pour chacun des liens ci-dessous, ne pas oublier le paramètre &format=json
Attention à bien requêter le https et non pas le http.
La ressource n'est pas encore complète
@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@ryansobol
ryansobol / gist:5252653
Last active November 22, 2023 11:53
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@kapkaev
kapkaev / gist:4619127
Created January 24, 2013 09:30
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Resque
$ redis-cli
> config set stop-writes-on-bgsave-error no