Skip to content

Instantly share code, notes, and snippets.

View Natim's full-sized avatar
🏠
Working from home

Rémy HUBSCHER Natim

🏠
Working from home
  • Silvr
  • Rennes
  • 05:12 (UTC +02:00)
  • X @Natim
View GitHub Profile
@Natim
Natim / vimeo.html
Created April 3, 2012 15:38
Vimeo Javascript Display Thumb
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
function vimeoLoadingThumb(id){
var url = "http://vimeo.com/api/v2/video/" + id + ".json?callback=showThumb";
var id_img = "#vimeo-" + id;
var script = document.createElement( 'script' );
script.type = 'text/javascript';
type alias Page =
{ name : String
, url : String
, created_at : Date
, title : String
, description : String
, url : String
}
@Natim
Natim / get_anchors.py
Last active March 8, 2017 12:51
Get anchors from Woleet
import aiohttp
import asyncio
import os
WOLEET_SERVER = 'https://api.woleet.io/v1'
WOLEET_HEADERS = {
'Authorization': 'Bearer {}'.format(os.getenv('WOLEET_BEARER_TOKEN')),
'Content-Type': 'application/json'
}
@Natim
Natim / README.md
Created May 25, 2016 14:42
A first kinto_bootstrap PoC

To use it:

python kinto_bootstrap.py -s http://localhost:8888 -a token:my-token -v
$ python kinto_bootstrap.py --help
usage: kinto_bootstrap.py [-h] [-s SERVER] [-a AUTH] [-b BUCKET] [-v] [-q]
                          [-D]

Bootstrap bucket
@Natim
Natim / scrap_amo_throttle.py
Created March 9, 2016 14:29
Scrap AMO with Python3 and asyncio
# -*- coding: utf-8 -*-
# This is PY3 only code using asyncIO
import asyncio
import aiohttp
import base64
import json
from random import randint
from kinto_client import Client, Endpoints
from pyquery import PyQuery as pyquery
@Natim
Natim / scrap_amo.py
Created March 9, 2016 12:30
For each addons, scrap AMO to get the who and why information.
# -*- coding: utf-8 -*-
# This is PY3 only code using asyncIO
import asyncio
import aiohttp
from pyquery import PyQuery as pyquery
async def fetch_info(session, record):
if 'blockID' not in record:
print("{} doesn't have a blockID".format(record['id']))
@Natim
Natim / gist:8456937
Last active January 3, 2016 11:29
Dans @capitainetrain -- Ouvrir tous les billets passé puis :
var value = 0;
var regex = /[+-]?\d+\,\d+/g;
$('.ember-view .price').each(function(){ value += $(this).html().match(regex).map(function(v) { return parseFloat(v.replace(',', '.')); })[0] });
console.log(value);
@Natim
Natim / requete.sql
Created December 3, 2013 15:20
Première requête PostGIS
SELECT numero, geom FROM parcelle
WHERE ST_Intersects(geom, ST_Transform(
ST_ConvexHull('SRID=4326;MULTIPOINT(2.232 48.818,
2.246 48.82,
2.241 48.809,
2.232 48.818)'::geometry),
27572));
@Natim
Natim / 25square.py
Last active December 25, 2015 22:29
Python2 and Python3 compatible carre de 25 encoder and decoder
# -*- coding: utf-8 -*-
from __future__ import print_function
from six.moves import input, xrange, map
from string import ascii_letters
alphabet = "ABCDEFGHIJKLMNOPQRSTUVXYZ"
def get_maps(keyword):
keyword = keyword.upper().replace('W', 'V')
@Natim
Natim / decodage.py
Created September 27, 2013 14:53
Carré de Polybe
# -*- coding: utf-8 -*-
M = [["A", "B", "C", "D", "E"],
["F", "G", "H", "IJ", "K"],
["L", "M", "N", "O", "P"],
["Q", "R", "S", "T", "U"],
["V", "W", "X", "Y", "Z"]]
def decode(texte):