Skip to content

Instantly share code, notes, and snippets.

@frostney
frostney / gist:4165353
Created November 28, 2012 22:56
Walking through folder recursively async (node.js): includes option to filter elements, hidden dot files and filenames with trailing underscore. (walkFiles function taken from http://stackoverflow.com/questions/7041638/walking-a-directory-with-node-js)
var path = require('path');
var fs = require('fs');
var es6shim = require('es6-shim');
/**
* dir: path to the directory to explore
* action(file, stat): called on each file or until an error occurs. file: path to the file. stat: stat of the file (retrived by fs.stat)
* done(err): called one time when the process is complete. err is undifined is everything was ok. the error that stopped the process otherwise
*/
var walkFiles = function(dir, action, done) {
@jeroavf
jeroavf / esp8266-esp01-relay-web-mqtt.ino
Last active April 18, 2024 16:57 — forked from murilopontes/esp8266-esp01-relay-web-mqtt.ino
ESP8266 ESP-01 relay control using Web server or MQTT
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
const char* wifi_ssid = "XXXXX";
const char* wifi_password = "XXXXX";
char* mqtt_server = "iot.eclipse.org";
char* mqtt_user = "";
@jthomas
jthomas / package.json
Last active September 24, 2023 21:58
Using TensorFlow.js with MobileNet models for image classification on Node.js
{
"name": "tf-js",
"version": "1.0.0",
"main": "script.js",
"license": "MIT",
"dependencies": {
"@tensorflow-models/mobilenet": "^0.2.2",
"@tensorflow/tfjs": "^0.12.3",
"@tensorflow/tfjs-node": "^0.1.9",
"jpeg-js": "^0.3.4"
@willprice
willprice / README.md
Last active February 8, 2023 21:27
Install OpenCV 4.1.2 for Raspberry Pi 3 or 4 (Raspbian Buster)

Install OpenCV 4.1.2 on Raspbian Buster

$ chmod +x *.sh
$ ./download-opencv.sh
$ ./install-deps.sh
$ ./build-opencv.sh
$ cd ~/opencv/opencv-4.1.2/build
$ sudo make install
/*
* Change Concept Type
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Updated from original to prompt for types
*
* Version 1: First release
* Version 2: Error handling
*
@Jimmy-Z
Jimmy-Z / services-start.sh
Created February 28, 2019 08:42
multi SSID with VLAN script, for ASUS AC86U with merlin
#!/bin/sh
# multi SSID with VLAN script, for ASUS AC86U with merlin
#
# setup before hand:
# set "router" to "AP Mode"
# this will put all ports and wireless in br0
# create 2 guest network
# enable Administration => System => Enable JFFS custom scripts and configs
# put this script in /jffs/scripts/, name should be "services-start"
@gevaertw
gevaertw / ArchiSQLGenerator.ajs
Last active May 14, 2024 20:36
#jarchi #ArchiSQLGenerator
/*
The goal is that a user creates a pattern on a view. Based on that pattern a SQL query is created to analyse the entire model for that view.
The model must be in a database created with herve database plugin (Link) This is very powerfull to analyse the model using SQL and by further extention BI tools like PowerBI
Check https://gevaertw.wordpress.com/generating-sql-queries-for-the-archi-database for more info
*/
//
//-------------------------- Script Settings --------------------------------------------------------------
// to set language comment or uncomment
@happytm
happytm / Livingroom.flow
Last active May 26, 2021 01:05
Node-Red RPIEasy Home Automation Flow
{
"id": "567d64ec.2661bc",
"label": "Livingroom",
"nodes": [
{
"id": "98b02e48.6b436",
"type": "switch",
"z": "567d64ec.2661bc",
"name": "Livingroom",
"property": "topic",
@robkamp
robkamp / ColorElements.ajs
Last active May 14, 2024 20:35
#jArchi Color the selected elements with web safe colors
// Author: Rob Kamp
// Requires: jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
// Purpose: Color the selected elements with web safe colors
// Date: 2019-11-20
// Version 1.1
// Change: changed the title to add the #jArchi tag
console.log("Start: Color the selected elemets");
// Web safe colors
@jbsarrodie
jbsarrodie / Delete unused elements and relationships.ajs
Created March 2, 2020 15:33
#jArchi scripts to delete any element (or relationship) not used in at least one view
// Delete unused elements and relationships
//
// Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
//
// This script will delete any element or relationship not used in at least one view
//
// (c) 2020 Jean-Baptiste Sarrodie
var response = window.confirm("This script will delete any element or relationship not used in at least one view. Continue?");