Skip to content

Instantly share code, notes, and snippets.

View JulienSansot's full-sized avatar

Julien Sansot JulienSansot

View GitHub Profile
@JulienSansot
JulienSansot / asynctest_controller.rb
Last active January 16, 2016 00:08
async controller in rails with Thin, EventMachine, em-synchrony, em-http-request
class AsynctestController < ApplicationController
require "em-synchrony/em-http"
def test
EventMachine.synchrony do
http = EventMachine::HttpRequest.new("https://www.google.co.uk/").get
render :json => {result: http.response}
@JulienSansot
JulienSansot / ansible playbook for deploying a node app on ubuntu
Created June 3, 2015 06:29
ansible playbook for deploying a node app on ubuntu
---
- hosts: all
remote_user: ubuntu
vars:
app_repo: [email protected]:****/****.git
app_id: my_app
app_folder: /home/ubuntu/my_app
log_folder: /home/ubuntu/my_app_logs
tasks:
- name: git clone
@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;