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
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
View example.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>simplyCountdown.js example</title>
<link rel="stylesheet" href="css/simplyCountdown.theme.default.css"/>
</head>
<body>
<section class="examples">
<div class="simply-countdown-example"></div>
@VincentLoy
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);
View console.sh
# Install from NPM
npm install share-selected-text
#Install from Bower
bower install share-selected-text
@VincentLoy
VincentLoy / block_tags.py
Last active Nov 30, 2016
Wagtail, tu aurais pu t'appeler Swagtail.
View block_tags.py
# templatetags/block_tags.py
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
VincentLoy / blocks.py
Created Mar 18, 2016 — forked from frankwiles/blocks.py
Code and Markdown blocks for Wagtail 1.0 StreamField
View blocks.py
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
VincentLoy / psql.md
Last active Apr 19, 2016
postgres command memo - migrate here : https://github.com/VincentLoy/alzheimer
View psql.md

Connect as root

$ sudo -u postgres psql

Create new user

postgres=# CREATE USER example WITH PASSWORD 'example';
@VincentLoy
VincentLoy / progress.py
Created Sep 10, 2015
Nice Python progress bar
View progress.py
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')
sys.stdout.flush()
View repair.py
# vim: fileencoding=utf-8 tw=100 expandtab ts=4 sw=4 :
#
# GoodMorningPlanet.com
# author : Vincent Loy <vincent.loy@activkonnect.com>
# (c) 2015 ActivKonnect
"""
Repair bad formatted Markdown Files - replace **foo** by #foo
only when a line start and end by strong tag
"""
@VincentLoy
VincentLoy / monty_hall.py
Created Jun 25, 2015
Test with the Monty Hall problem
View monty_hall.py
# vim: fileencoding=utf-8 tw=100 expandtab ts=4 sw=4 :
#
# monty-hall-problem
# copyright (c) 2015 Vincent Loy
# Vincent Loy <vincent.loy1@gmail.com>
import random
class MontyHall:
def __init__(self):
You can’t perform that action at this time.