Skip to content

Instantly share code, notes, and snippets.

View llaine's full-sized avatar
🚀

Louis Lainé llaine

🚀
View GitHub Profile
@llaine
llaine / Dockerfile
Created June 3, 2016 14:27
dockerfile
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y wget
RUN wget http://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list
RUN apt-get update && apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring && apt-get update \
&& apt-get install -y dmd-bin dub libcurl3-gnutls libevent-dev libcrypto++-dev libssl-dev
# Where the app live inside the container
ENV APP_ROOT /var/www/dlang-api-ecratum
[llaine@localhost foo] $ dub -v --compiler=ldc2
Using dub registry url 'http://code.dlang.org/'
Refreshing local packages (refresh existing: true)...
Looking for local package map at /var/lib/dub/packages/local-packages.json
Looking for local package map at /home/llaine/.dub/packages/local-packages.json
Note: Failed to determine version of package foo at .. Assuming ~master.
Refreshing local packages (refresh existing: false)...
Looking for local package map at /var/lib/dub/packages/local-packages.json
Looking for local package map at /home/llaine/.dub/packages/local-packages.json
Found dependency vibe-d 0.7.30-alpha.1
@llaine
llaine / gist:673969a8b87f5f0355970df9c69e7e6f
Created May 4, 2016 08:07
prepared statement with rails and postgresql
connection = ActiveRecord::Base.connection.raw_connection
=> #<PG::Connection:0x00563e2c718098>
[30] pry(main)> connection.prepare('user_id', "select * from users where id = $1")
PG::DuplicatePstatement: ERROR: prepared statement "user_id" already exists
from (pry):35:in `prepare'
[31] pry(main)> st = connection.exec_prepared('user_id', [786])
=> #<PG::Result:0x00563e26a5bd78 status=PGRES_TUPLES_OK ntuples=1 nfields=29 cmd_tuples=1>
[32] pry(main)> st.each_row do |x|
[32] pry(main)* p x
[32] pry(main)* end
import React, {Component} from 'react';
import {render} from 'react-dom';
// Parent Component
class TimelineContainer extends Component {
constructor(props) {
super(props);
this.state = {
currentSupplier:'A',
currentYear:'2010',
@llaine
llaine / index.md
Created March 9, 2016 13:15
Coltrane album
  • Olé
  • Prestige 7105
  • Lush life
  • Traneing in Coltrane with the red garland trio
  • the last trane
  • ballads
  • coltrane
  • live at the village
  • live at birland
  • bags and trane
@llaine
llaine / interactive-rebase.sh
Last active October 20, 2015 10:14
git rebase -i on the commit we want to change
$ git rebase -i a860a43~
1 edit a860a43 Add footer + rename header menus
2 fixup 1e2ac88 Add style.css (footer)
3 pick c09d958 Add breadcrumb
4 pick 0e37c70 Add jumbotron
@llaine
llaine / bash.sh
Created October 20, 2015 09:29
Rebase example 1
$ git log --pretty=format:"%h %s" HEAD~3..HEAD
adcf4a6 Adding navbar (Part 3)
0cdff26 Adding navbar (Part 2)
0ce7553 Adding navbar (Part 1)
@llaine
llaine / td.pl
Last active October 19, 2015 13:52
TD de prolog
% http://dept-info.labri.u-bordeaux.fr/~musumbu/Expert/td2.pdf
/*
***************** Les faits *******************
Arguemnts du predicat bio :
bio(enfant, sexe, annee_naissance, annee_mort, pere, mere)
*/
bio(louis13, h, 1601, 1643, henri4, marie_medicis).
bio(elisabeth_France, f, 1603, 1644, henri4, marie_medicis).
@llaine
llaine / gist:67ac1cf217966ffbad7d
Created July 26, 2015 10:39
Meteor france API

Récupérer l'ID de la ville correspondante.

var input = "Pessac"

http://www.meteofrance.com/mf3-rpc-portlet/rest/lieu/facet/pluie/search/input

Renvoie un truc du style :

[ {
  "id" : "333180",
@llaine
llaine / gist:7819d4bf764c18d5d8ca
Created July 24, 2015 09:00
recommendedReasonPhrases
[recommendedReasonPhrases:protected] => Array
(
[100] => Continue
[101] => Switching Protocols
[102] => Processing
[200] => OK
[201] => Created
[202] => Accepted
[203] => Non-Authoritative Information
[204] => No Content