This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Chargement de la page HTML à parser... | |
## Récupérer tous les liens par selecteur XPath | |
## //table[1]/tbody/tr/td[1]/a | |
user system total real | |
hpricot 17.630000 0.510000 18.140000 ( 21.813587) | |
nokogiri 2.700000 0.100000 2.800000 ( 3.076731) | |
## Récupérer une cellule du tableau spécifique par selecteur XPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -X GET http://localhost:4000/page.html | |
Hello World | |
$ curl -X POST http://localhost:4000/page.html -d "" | |
<html> | |
<head><title>405 Not Allowed</title></head> | |
<body bgcolor="white"> | |
<center><h1>405 Not Allowed</h1></center> | |
<hr><center>nginx/0.6.34</center> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name my.host.com; | |
location / { | |
root /path/to/your/root; | |
post_to_static on; # You allow static file after a POST request | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example of MPVolume which doesn't work on SDK 3.0 | |
MPVolumeView *volumeView = [[MPVolumeView alloc] init]; | |
[volumeView sizeToFit]; | |
[self.view addSubview:volumeView]; | |
[volumeView release]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hash = document.location.hash.replace('#', ''); | |
$('a[data-target='+hash+']').trigger('click'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This Script aims to setup a docker environment for Linux or OSX with docker client, docker-machine and docker-compose | |
# All binaries are install in /usr/local/bin/ directory. | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' # No Color | |
os=$(uname -s) | |
arch=$(uname -m) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM elixir:1.5.0 | |
WORKDIR /app | |
# Install Hex | |
RUN mix local.hex --force | |
# Install rebar3 | |
# Needed to compile dependency :ranch | |
RUN mix local.rebar --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
i=0 | |
while [ $? == 0 ] | |
do | |
i=$((i+1)) | |
curl https://registry.hub.docker.com/v2/repositories/library/ruby/tags/?page=$i 2>/dev/null|jq '."results"[]["name"]' | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Customer = Struct.new(:name, :address, keyword_init: true) | |
Customer.new(name: "Dave", address: "123 Main") | |
#=> #<struct Customer name="Dave", address="123 Main"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Before you had to use begin | |
lambda do | |
begin | |
raise 'err' | |
rescue | |
$! # => #<RuntimeError: err> | |
end | |
end.call | |
# Now you can simply use rescue |
OlderNewer