Skip to content

Instantly share code, notes, and snippets.

Working from home

Vincent Loy VincentLoy

Working from home
Block or report user

Report or block VincentLoy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Install Android emulator on Ubuntu and run the Ionic app on mobile
1. install openjdk
`sudo apt-get install openjdk-7-jdk`
2. install `android sdk`
# download android sdk
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
View example.html
<!DOCTYPE html>
<head lang="en">
<meta charset="UTF-8">
<title>simplyCountdown.js example</title>
<link rel="stylesheet" href="css/simplyCountdown.theme.default.css"/>
<section class="examples">
<div class="simply-countdown-example"></div>
VincentLoy / variables.less
Created Jul 5, 2016
Bootstrap Media queries LESS
View variables.less
@screen-phone: 480px;
@screen-tablet: 760px;
@screen-desktop: 992px;
@screen-lg-desktop: 1200px;
@screen-xs-max: (@screen-phone - 1);
@screen-sm-max: (@screen-tablet - 1);
@screen-md-max: (@screen-desktop - 1);
# Install from NPM
npm install share-selected-text
#Install from Bower
bower install share-selected-text
VincentLoy /
Last active Nov 30, 2016
Wagtail, tu aurais pu t'appeler Swagtail.
# templatetags/
import re
register = template.Library()
@register.inclusion_tag('tags/embed_tweet.html', takes_context=True)
def tweet_embed(context, url):
return {
'url': '{}'.format(url),
'request': context['request'],
VincentLoy /
Created Mar 18, 2016 — forked from frankwiles/
Code and Markdown blocks for Wagtail 1.0 StreamField
from django.utils.safestring import mark_safe
from markdown import markdown
from pygments import highlight
from pygments.formatters import get_formatter_by_name
from pygments.lexers import get_lexer_by_name
from wagtail.wagtailcore import blocks
class CodeBlock(blocks.StructBlock):
VincentLoy /
Last active Apr 19, 2016
postgres command memo - migrate here :

Connect as root

$ sudo -u postgres psql

Create new user

postgres=# CREATE USER example WITH PASSWORD 'example';
VincentLoy /
Created Sep 10, 2015
Nice Python progress bar
import sys
def progress(count, total, suffix=''):
bar_len = 50
filled_len = int(round(bar_len * count / float(total)))
percents = round(100.0 * count / float(total), 1)
bar = '' * filled_len + '' * (bar_len - filled_len)
sys.stdout.write('==> {} {}{} ... {}'.format(bar, percents, '%', suffix), ending='\r')
# vim: fileencoding=utf-8 tw=100 expandtab ts=4 sw=4 :
# author : Vincent Loy <>
# (c) 2015 ActivKonnect
Repair bad formatted Markdown Files - replace **foo** by #foo
only when a line start and end by strong tag
VincentLoy /
Created Jun 25, 2015
Test with the Monty Hall problem
# vim: fileencoding=utf-8 tw=100 expandtab ts=4 sw=4 :
# monty-hall-problem
# copyright (c) 2015 Vincent Loy
# Vincent Loy <>
import random
class MontyHall:
def __init__(self):
You can’t perform that action at this time.