Skip to content

Instantly share code, notes, and snippets.

@tmaziere
tmaziere / farmbot_commander.py
Created April 2, 2021 15:46
A basic example of GUI python app usable to send commands to your Farmbot through farmbot-py
from farmbot import Farmbot, FarmbotToken
import threading
import time
import wx
class MyHandler:
def on_connect(self, bot, mqtt_client):
bot.send_message("Hello, farmbot!")
@tmaziere
tmaziere / golden-mess.pyde
Created January 20, 2021 11:01
Golden mess
add_library('svg')
scl = 10
margin = 5
cols = 20
rows = 35
OUTPUT_SVG_FILE = './svg/golden-mess.svg'
def setup():
size(500, 500)
background(0)
@tmaziere
tmaziere / display_all_methods.js
Created April 10, 2017 14:21
Display all methods of an object in Javascript
console.log(Object.getOwnPropertyNames(myObject).filter(function (m) {
return typeof myObject[m] === 'function';
}));
@tmaziere
tmaziere / 0_reuse_code.js
Created October 29, 2016 13:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tmaziere
tmaziere / virtualenv_python3.sh
Last active June 17, 2016 14:46
Creating python local and isolated virtual environment (for a specific project, with specific packages/versions)
# install virtualenv
pip install virtualenv
# reach your project directory
cd my_project_folder
# create a local virtual environment (here : python3)
virtualenv -p /usr/bin/python3 py3env
# activate venv
source py3env/bin/activate
# install project package(s)
pip install package-name