Skip to content

Instantly share code, notes, and snippets.

@rahulchinta97
rahulchinta97 / PY0101EN-2-3-Dictionaries.ipynb
Created April 23, 2020 09:04
Created on Skills Network Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rahulchinta97
rahulchinta97 / PY0101EN-2-2-Lists.ipynb
Created April 23, 2020 09:04
Created on Skills Network Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/*
*Finite State Machine (FSM) Example in C
* that makes use of function pointers
*
* Programmed by wrh2 (github.com/wrh2)
*/
#include <stdio.h>
/* declare struct for FSM */
struct fsm;
@ozel
ozel / Fsm.cpp
Created April 13, 2018 22:04
OpenAuto FSM demo code
// This file is part of arduino-fsm.
//
// arduino-fsm is free software: you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option)
// any later version.
//
// arduino-fsm is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
//***VARIABLES AND SUCH***
#include <Time.h>
#include <TimeLib.h>
#include <Adafruit_NeoPixel.h>
//Variables associated with Clock FSM
int t_hour = 20;
int t_minute = 29;
int t_second = 50;
@joepie91
joepie91 / express-server-side-rendering.md
Last active April 26, 2025 08:11
Rendering pages server-side with Express (and Pug)

Terminology

  • View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
  • View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
  • HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
  • String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
@M165437
M165437 / db-connect-test.php
Last active November 7, 2024 10:11 — forked from chales/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
const int speedLB = 200;
const int speedLF = speedLB - 10;
const int speedRB = speedLB - 10;
const int speedRF = speedLB;
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
@ypelletier
ypelletier / ESP8266_Web_Display.ino
Last active July 30, 2019 13:57
Affichage dans une page web de l'état des pins GPIO 4, GPIO 5 et ADC d'un module ESP8266.
/********************************************************************************************
Affichage dans une page web de l'état des broches GPIO 4, GPIO 5
et ADC d'un module ESP8266 ou ESP32.
http://electroniqueamateur.blogspot.ca/2016/03/afficher-dans-une-page-web-letat-des.html
********************************************************************************************/
// inclusion des bibliothèques utiles
// pour la communication WiFi
@subfuzion
subfuzion / curl.md
Last active October 11, 2025 00:58
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.