Skip to content

Instantly share code, notes, and snippets.

View ArnaudBrousseau's full-sized avatar
👾
yoink

Arnaud Brousseau ArnaudBrousseau

👾
yoink
View GitHub Profile
GET /user/v2?ids=1,2,42
[
{"id": 1, "first_name": "Bob", "review_count": 0, ...},
{"id": 2, "first_name": "Alice", "review_count": 4, ...},
{"id": 42, "first_name": "Mark", "review_count": 2, ...}
]
@ArnaudBrousseau
ArnaudBrousseau / classic_rest.txt
Created March 5, 2018 12:34
Classic REST endpoint
GET /user/42
{"id": 42, "first_name": "Mark", "review_count": 2, ...}
srv-configs
├── casper
│ ├── service.foo.main.yaml
│ ├── service.bar.main.yaml
│ ├── ...
@ArnaudBrousseau
ArnaudBrousseau / service.foo.main.yaml
Created March 5, 2018 12:20
Sample Casper config file
cached_endpoints:
foo_cache: {ttl: 300, pattern: "^/foo/bar$"}
vary_headers:
- Accept-Encoding
uncacheable_headers:
- 'Date'
- 'X-Zipkin-Id'
@ArnaudBrousseau
ArnaudBrousseau / page-border.css
Created December 19, 2010 22:41
Create pure CSS borders w/o extra markup | credits to http://csswizardry.com/
/* Create a series of empty pseudo-elements... */
html:before,html:after,body:before,body:after{
content:"";
background:#dad8bb;
position:fixed;
display:block;
z-index:5;
}
/* ...and position them! */
.note {
position:relative;
width:30%;
padding:1em 1.5em;
margin:2em auto;
color:#fff;
background:#97C02F;
overflow:hidden;
}
@ArnaudBrousseau
ArnaudBrousseau / getFavicon.php
Created December 18, 2010 21:13
Quite handy : getting a 16x16 PNG file given a particular URL - via Google S2 service
function get_favicon($url){
$url = str_replace("http://",'',$url);
//TODO : regex that removes the last part of the url and detects errors
return "http://www.google.com/s2/favicons?domain=".$url;
}
@ArnaudBrousseau
ArnaudBrousseau / .vimrc
Created December 18, 2010 21:09
My .VIMRC file. Trying to constantly improve it with things I see here and there
set nocompatible
"no file like 'myfile~'. What a relief.
set nobackup
colorscheme fruit
set guifont=Courier_new:h12
"Tab stuff
set tabstop=2