Ctrl + Alt + Space
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) |
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 |
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 |
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
{"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"}," |
Dump of all commands from "So You Think You Know Git - FOSDEM 2024":
The full blog post: https://blog.gitbutler.com/git-tips-and-tricks/
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]; |
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 |
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 :
- 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.