Skip to content

Instantly share code, notes, and snippets.

@depfryer
depfryer / flem.js
Created September 8, 2022 18:08
flem.js pour violentmonkey (a adapter au site voulu), permet simplement de copier dans le presse papier un element dans un id
// ==UserScript==
// @name scriptflem_getInfo
// @namespace Violentmonkey Scripts
// @version 1.0.0
// @match
// @downloadURL
// @updateURL
// @homepageURL
// @grant GM_setClipboard
// @grant GM_notification
@depfryer
depfryer / handbrake.py
Created March 4, 2022 03:09
automate handbrake with python work with windows, pretty sure linux too
from re import A
import subprocess
import os
import time
import logging
import sys
from shutil import copyfile
from pathlib import Path
from pydantic import FilePath
@depfryer
depfryer / Get_power.py
Created January 8, 2022 22:11
get the temperature and power consumtion and save it in influxdb
#!/usr/bin/python3
from datetime import datetime, time
from time import sleep
from requests import exceptions
import pymodbus
import serial
import math
@depfryer
depfryer / client_async.py
Created October 25, 2021 10:19
python stream server exemple
import asyncio
import httpx
async def async_client():
async with httpx.AsyncClient() as client:
async with client.stream('GET', 'http://127.0.0.1:5000/large.csv') as response:
async for chunk in response.aiter_text():
print(chunk)
updateGame = function(delta) {
/* to update the location of the game, we're going to simulate it's position at
every millisecond since the last update. */
for (var i = 0; i < delta && state == updateGame; ++i) {
// move the ball
ball.advance();
// check to see what happened to the ball
if (!ball.bounced(p1, p2, PLAY_HEIGHT - LINE_WIDTH)) {
var scoringPlayer = null;
@depfryer
depfryer / Client.py
Last active July 23, 2020 08:20
customers to take action one after the other
import asyncio
import json
import random
import websockets
from time import sleep
async def consumer(message):
if json.loads(message)['next'] == '0':
sleep(15) # Do what you want
@depfryer
depfryer / Snmp.py
Last active October 9, 2019 14:33
simple class addon for pysnmp
from pysnmp.hlapi import *
# credential is like CommunityData('public') (for v2)
# target is a IP
# then simply do :
# s = snmpy('demo.snmplabs.com', CommunityData('public'))
# o = s.get_Tree(['1.3.6.1.2.1.2.2.1.2'])
# v = s.get(['1.3.6.1.2.1.2.2.1.2.2'])
# print(v)
# for a in o:
# print(a)