Skip to content

Instantly share code, notes, and snippets.

View robert-hoffmann's full-sized avatar

Robert Hoffmann robert-hoffmann

View GitHub Profile
@robert-hoffmann
robert-hoffmann / myRouter.js
Created July 4, 2025 20:56
VanillaJS (VueRouter style) Router
const MyRouter = (function(win) {
// Create a safe default route object
const createSafeRoute = (routeData = null) => {
if (!routeData) {
return {
query : {},
path : "",
params: {}
};
}
@robert-hoffmann
robert-hoffmann / fetchFromAirtable.js
Last active May 28, 2021 13:30
Get all records from AirTable with simple Fetch/REST (Vanilla JS)
let airtable = {
// Name of the view (change this)
view: "api",
// Database identifier (change this)
database: "appDatabaseIdentifier",
// Auth Key => Use a client with read-only permissions for security (change this)
auth: "keyAuthKey"
};
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active January 14, 2026 06:50
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@dmnsgn
dmnsgn / SingletonDefaultExportInstance.js
Last active February 9, 2023 16:54
ES6 singleton pattern: module default exports an instance
class SingletonDefaultExportInstance {
constructor() {
this._type = 'SingletonDefaultExportInstance';
}
singletonMethod() {
return 'singletonMethod';
}
static staticMethod() {
@alch
alch / .htaccess
Last active October 19, 2025 18:58
Symfony full .htaccess file
# For a symfony application to work properly, you MUST store this .htaccess in
# the same directory as your front controller, index.php, in a standard symfony
# web application is under the "public" project subdirectory.
# Use the front controller as index file.
DirectoryIndex index.php
# Uncomment the following line if you install assets as symlinks or if you
# experience problems related to symlinks when compiling LESS/Sass/CoffeScript.
# Options +FollowSymlinks
@anantn
anantn / getusermedia_picture.html
Created February 17, 2012 09:12
Take a picture with getUserMedia
<html>
<body>
<video id="v" width="300" height="300"></video>
<input id="b" type="button" disabled="true" value="Take Picture"></input>
<canvas id="c" style="display:none;" width="300" height="300"></canvas>
</body>
<script>
navigator.getUserMedia({video: true}, function(stream) {
var video = document.getElementById("v");
var canvas = document.getElementById("c");