Skip to content

Instantly share code, notes, and snippets.

// This post referred to this git. I just trimmed cam and wifi part.
// https://github.com/v12345vtm/CameraWebserver2SD/blob/master/CameraWebserver2SD/CameraWebserver2SD.ino
#include "FS.h"
#include "SD_MMC.h"
//List dir in SD card
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
Serial.printf("Listing directory: %s\n", dirname);
@berardo
berardo / angular-nativescript-course-setup.sh
Last active June 25, 2022 12:28
Script to install all good tools on a fresh new macOS machine. Some command are commented out because the main reason for this file is to be used on my online course: https://udemy.com/angular-native
#!/bin/sh
# Allow locate commands
# sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
# xcode command line - Select: "Get xcode" and go get a coffee (preferably far from your desk :)
xcode-select --install
# home-brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@btray77
btray77 / xml2json.js
Last active April 15, 2021 23:56
RegEX to parse XML to JSON
// Original from: http://killzonekid.com/worlds-smallest-fastest-xml-to-json-javascript-converter/
// Thanks to Loamhoof for helping get this working!
// http://stackoverflow.com/questions/15675352/regex-convert-xml-to-json/15680000
//Load XML into XML variable
var regex = /(<\w+[^<]*?)\s+([\w-]+)="([^"]+)">/;
while (xml.match(regex)) xml = xml.replace(regex, '<$2>$3</$2>$1>');
xml = xml.replace(/\s/g, ' ').
Backbone.Cloudant.database = "/sandbox/";
// start the change handler
// Backbone.Cloudant.changeHandler();
PersonView = Backbone.View.extend({
initialize: function () {
this.render();
},
template: _.template($("#person_template").html()),
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active June 18, 2024 18:27
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh