Skip to content

Instantly share code, notes, and snippets.

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

Gilbert Brault gbrault

🏠
Working from home
  • Vence
View GitHub Profile
@gbrault
gbrault / callsyncinasync.py
Created May 10, 2019 14:01
Calling synchronous code from asyncio
import asyncio
import time
from urllib.request import urlopen
@asyncio.coroutine
def count_to_10():
for i in range(11):
print("Counter: {}".format(i))
yield from asyncio.sleep(.5)
@gbrault
gbrault / split-four.html
Created February 27, 2018 08:51
split a window into four adjustable divisions
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
(function () {
/**
* THIS OBJECT WILL ONLY WORK IF your target is positioned relative or absolute,
@gbrault
gbrault / splitter.html
Created February 27, 2018 06:34
html div based splitter
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
(function () {
/**
* THIS OBJECT WILL ONLY WORK IF your target is positioned relative or absolute,
@gbrault
gbrault / dev tool install.txt
Created February 26, 2018 14:42
node js dev tool install
npm install -g windows-build-tools
@gbrault
gbrault / gist:faaa617380c986d48b143de54e3fb278
Last active October 28, 2017 07:57
Embeded device shops
https://www.netblocks.eu
http://sandboxelectronics.com
http://www.kaayee.com/
http://www.ifroglab.com
http://www.lilygo.cn
http://www.rakwireless.com/en/
https://www.futurashop.it
https://bsfrance.fr
http://www.dorji.com/
https://www.digitalsmarties.net/ (jeelab shop)
@gbrault
gbrault / gist:a42b012d774d2d26c70808859a017140
Created April 15, 2017 13:37
how to ssh a docker container
- create an ubuntu docker container with kitematic
- load ssh-server with apt-get
- edit /etc/ssh/ssh_config and undash PasswordAuthentication yes
- restart ssh (su + service ssh restart)
- add a new user in the admin
example: adduser gbrault
then usermod -aG sudo gbrault
- add an host port 2222 to container 22 in kitematic
open localhost:2222 with winscp or putty
https://github.com/netbeast/docs/wiki/Cross-Compile-Nodejs-for-OpenWrt
@gbrault
gbrault / text2image.html
Created March 20, 2017 17:07
put text into image (to avoid CORS)
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var c = document.getElementById("myCanvas");
@gbrault
gbrault / marimekko.json
Last active February 21, 2017 15:35
json data model for marimekko
{
"title":"Top Players (>={{ratio_thresold}}%MS) ranking for Automation Markets {{size}} $Bn",
"size":104991.775070619,
"currency":"$",
"display":"Bn",
"internal":"Kn",
"ratio_threshold":3,
"rows":[
{"title":"01- DCS",
"size":13521.0076579863,
@gbrault
gbrault / showhide.js
Created January 11, 2017 14:39
vis.js node,edge show/hide
var nodes = new vis.DataSet([
{id: 2696, label: "2696", hidden: false},
{id: 1205, label: "1205", hidden: false},
{id: 2697, label: "2697", hidden: false},
{id: 2021, label: "2021", hidden: true},
{id: 2047, label: "2047", hidden: true}
]);
var edges = new vis.DataSet([
{id: 'e1', from: 2696, to: 2697, hidden: false},