Skip to content

Instantly share code, notes, and snippets.

View Drarig29's full-sized avatar
🤠
Exploring the TypeScript AST

Corentin Girard Drarig29

🤠
Exploring the TypeScript AST
View GitHub Profile
@Yann0128
Yann0128 / README.md
Last active January 25, 2025 07:16
Intuis connect sur Node RED - v1.4 2024 par Yann V

Ce flow permet de se connecter à l'API Intuis connect (by Netatmo) pour récupérer toutes les infos concernant les radiateurs du domicile : température instantanée, consigne, état, détecteur présence, fenêtre ouverte et consommation jounalière.

Pour le créer, je me suis basé sur le flow existant "Get Netatmo Weather station data" de matz33 qui permet de récupérer le token sur les serveurs Netatmo puis j'ai improvisé avec les commandes Intuis connect en les récupérants depuis l'application sur Iphone.

Pour l'exploiter, il faut une bonne maitrise de Node RED ainsi que des connaissances Java.

Notice d'installation :

  1. mise à jour des noeuds : Le flow est générique, il est nécessaire de renseigner vos identifants et d'adapter les noeuds au nombre de pièces et de modules à votre domicile.
@Drarig29
Drarig29 / better-git-checkout.sh
Last active April 20, 2024 11:51
Git checkout with fuzzy search and automatic branch swap between worktrees
function swap_worktree_branch_with() {
# Run the command again to get the error message
error_message=$(git switch $1 2>&1)
culprit_worktree=$(echo $error_message | grep "is already used by worktree at" | cut -d "'" -f4)
if [ -z "$culprit_worktree" ]; then
return
fi
# Save the branch in current worktree, and detach the HEAD so that we can switch to this branch in the culprit worktree
diff --git a/lib/importDeclaration.js b/lib/importDeclaration.js
index afb4de779034cfea080825a5f4320661c48bee32..236a853d1d5279d622819ff1e3fcd36a7fb49014 100644
--- a/lib/importDeclaration.js
+++ b/lib/importDeclaration.js
@@ -1,5 +1,5 @@
-"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = importDeclaration;function importDeclaration(context) {
- var ancestors = context.getAncestors();
+"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = importDeclaration;function importDeclaration(context, node) {
+ var ancestors = context.getSourceCode().getAncestors(node);
return ancestors[ancestors.length - 1];
@kulbhushanchand
kulbhushanchand / aw-category-export.json
Created June 20, 2021 03:31
ActivityWatch category export file (causes problem with v0.11.0)
{"categories":[{"name":["Work"],"rule":{"type":"regex","regex":"Google Docs|libreoffice|ReText"},"id":0},{"name":["Work","Programming"],"rule":{"type":"regex","regex":"GitHub|Stack Overflow|BitBucket|Gitlab|vim|Spyder|kate"},"id":1},{"name":["Work","Programming","ActivityWatch"],"rule":{"type":"regex","regex":"ActivityWatch|aw-","ignore_case":true},"id":2},{"name":["Media","Games"],"rule":{"type":"regex","regex":"Minecraft|RimWorld|Grand Theft Auto V|RetroArch"},"id":3},{"name":["Media","Video"],"rule":{"type":"regex","regex":"YouTube|Plex|VLC"},"id":4},{"name":["Media","Social Media"],"rule":{"type":"regex","regex":"reddit|Facebook|Twitter|Instagram|devRant","ignore_case":true},"id":5},{"name":["Media","Music"],"rule":{"type":"regex","regex":"Spotify|Deezer|MusicBee","ignore_case":true},"id":6},{"name":["Comms","IM"],"rule":{"type":"regex","regex":"Messenger|Telegram|Signal|WhatsApp|Rambox|Slack|Riot|Discord"},"id":7},{"name":["Comms","Email"],"rule":{"type":"regex","regex":"Gmail|Thunderbird|mutt|alpine"},"
@sindresorhus
sindresorhus / esm-package.md
Last active May 14, 2025 06:52
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@riggaroo
riggaroo / create_release_branch.yml
Last active October 31, 2024 21:45
Github Action workflow for creating release branch, updating versionName and versionCode, copying strings.xml to another repo, submitting PRs as per GitFlow.
name: Create Release Branch
on:
workflow_dispatch:
inputs:
versionName:
description: 'Name of version (ie 5.5.0)'
required: true
versionCode:
description: 'Version number (50500)'
required: true
@simonthompson99
simonthompson99 / temp-zip-file.py
Last active December 5, 2024 05:34
[Zip to temporary file] Make a temporary zip file and write to it #python #file_operations
import tempfile
import zipfile
# make archive.zip in temp directory
tmpdir = tempfile.mkdtemp()
zip_fn = os.path.join(tmpdir, 'archive.zip')
zip_obj = zipfile.ZipFile(zip_fn, 'w')
for f in files:
zip_obj.write(f, os.path.basename(f)) # add file to archive, second argument is the structure to be represented in zip archive, i.e. this just makes flat strucutre
@apieceofbart
apieceofbart / test.js
Last active August 20, 2024 23:56
Async testing with jest fake timers and promises
PLEASE CHECK THIS REPO WITH THE EXAMPLES THAT YOU CAN RUN:
https://github.com/apieceofbart/async-testing-with-jest-fake-timers-and-promises
// Let's say you have a function that does some async operation inside setTimeout (think of polling for data)
function runInterval(callback, interval = 1000) {
setInterval(async () => {
const results = await Promise.resolve(42) // this might fetch some data from server
callback(results)
}, interval)
@bittner
bittner / keyboard-keys.md
Created February 28, 2019 22:50
Keyboard keys markup in MarkDown

Ctrl + Alt + Space