Skip to content

Instantly share code, notes, and snippets.

View JulienSansot's full-sized avatar

Julien Sansot JulienSansot

View GitHub Profile
@JulienSansot
JulienSansot / test_checkout.rb
Last active August 11, 2020 15:08
Checkout.com tests
# You need a .env file in the same folder:
# PUBLIC_KEY=....
# SECRET_KEY=....
#
# And then run with ruby test_checkout.rb
#
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'

Keybase proof

I hereby claim:

  • I am kalagan on github.
  • I am juliensansot (https://keybase.io/juliensansot) on keybase.
  • I have a public key ASCmcLwirMrKxlfHxSygRA4QMbvfEnj6_qf0e4L4Dhm62Ao

To claim this, I am signing this object:

This file has been truncated, but you can view the full file.
A
A'asia
A's
AA
AA's
AAA
AAM
AB
AB's
ABA
@JulienSansot
JulienSansot / app.json
Created June 16, 2017 16:22
heroku postdeploy script to copy PG database
{
"scripts": {
"postdeploy": "pg_dump -Fc $DATABASE_URL_TO_COPY | pg_restore --clean --no-owner -n public -d $DATABASE_URL && bundle exec rails db:migrate"
}
}
@JulienSansot
JulienSansot / center image in div
Last active November 7, 2017 09:35
center image in div
- 1
the image uses the full width or full height of the div
we always see all the image, nothing is cropped
<div class="container"></div>
.container {
width: 500px;
height: 300px;
border: 1px solid black;
background-image: url("http://placehold.it/200x400");
background-repeat: no-repeat;
http://mdbootstrap.com/live/_MDB/index/docs/presentation-free/lp-components.html
@JulienSansot
JulienSansot / paperclip crop.rb
Last active October 10, 2016 16:42
paperclip crop
# Original image is 2048 × 2048
{
# final image is scaled down to 500x100. the cropped section is the vertical center
style_1: "500x100#",
# final image is scaled down to 100x100. It shows everything
style_2: "500x100>",
# final image is scaled down to 100x100. It shows everything. same as style_2
style_3: "500x100"
@JulienSansot
JulienSansot / index.html
Last active July 1, 2016 07:54
scatter sequential
<!DOCTYPE html>
<meta charset="utf-8"><style>
body {
margin-top:100px;
}
</style>
<body>
<script src="https://code.jquery.com/jquery-3.0.0.slim.min.js"></script>
@JulienSansot
JulienSansot / .block
Last active July 1, 2016 06:35
scatter
license: gpl-3.0
rescue_from DashboardErrors::Unauthorized do
respond_to do |format|
format.html { render } # 403
format.html { redirect_to @role }
format.json { render json: { error: "Unauthorized" }, status: :method_not_allowed } # 403
end
end