Skip to content

Instantly share code, notes, and snippets.

View dkgrieshammer's full-sized avatar
🎯
Focusing

David Grieshammer dkgrieshammer

🎯
Focusing
View GitHub Profile
@dkgrieshammer
dkgrieshammer / p5-printScale.js
Created August 29, 2023 15:57
P5js hack to adjust export for printing
// P5js hack to adjust export for printing.
const exportScale = 4;
function keyPressed() {
if (key == 's' || key == 'S'){
pixelDensity(exportScale);
draw();
let fileName =
"yourP5project_" + year() + "_" + month() +
"_" + day() + "_" + hour() + "_" + minute() +
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="YOURSSID"
psk="YOURPASSWORD"
scan_ssid=1
}
import React from 'react';
import Table from 'Components/Table/Table';
export default {
title: 'Table'
}
export const Header = () => {
return(
<Table>
@dkgrieshammer
dkgrieshammer / jsconfig.json
Last active July 10, 2020 10:32
Short form without alias
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src/**/*"]
}
@dkgrieshammer
dkgrieshammer / jsconfig.json
Created July 10, 2020 10:25
jsconfig.json to intellij absolute paths for vscode
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
//Assuming your components/utilities live in ./src
//Update this path as necessary
"@Components/*": ["./src/Components/*"]
}
},
"include": ["src/**/*"]
@dkgrieshammer
dkgrieshammer / canvas-transform.scss
Created June 25, 2020 17:26
Transform canvas elements
.canvas_container {
position: absolute;
left: 50%;
bottom: 0px;
perspective: 1000; //fucking perpective needed :D
-webkit-perspective: 1000;
canvas {
// width: 200px !important; //important to force p5js canvas to scale
// height: 200px !important;
// transform: rotateY(20deg); //works
@dkgrieshammer
dkgrieshammer / listMediaDevices.js
Created June 25, 2020 07:11
Lists available inputs like Webcams and Audio Inputs in JS - using it in P5.js to select different cameras for capture
// logs all Devices to console; if served via HTTPS or permission for Media is granted, devices will have clear names
// otherwise the list will only show cryptic IDs
navigator.mediaDevices.enumerateDevices().then(function (devices) {
devices.forEach(function(device) {
console.log(device)
})
})
@dkgrieshammer
dkgrieshammer / launch.json
Created May 25, 2020 09:56
Debugging Config for Visual Studio Code with Chrome DevTools and Create React App - custom userDataDir to save React & Redux DevTools and Extensions permanently 🥳
{
// Verwendet IntelliSense zum Ermitteln möglicher Attribute.
// Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
@dkgrieshammer
dkgrieshammer / rotarykey.ino
Created November 9, 2019 18:06
Rotary Encoder + Button Keyboard Output (Arduino Pro Micro)
#include <Keyboard.h>
/* interrupt routine for Rotary Encoders
tested with Noble RE0124PVB 17.7FINB-24 https://www.nobleusa.com/pdf/xre.pdf - available at pollin.de
and a few others, seems pretty universal
The average rotary encoder has three pins, seen from front: A C B
Clockwise rotation A(on)->B(on)->A(off)->B(off)
CounterCW rotation B(on)->A(on)->B(off)->A(off)
and may be a push switch with another two pins, pulled low at pin 8 in this case
@dkgrieshammer
dkgrieshammer / rotary.ino
Created November 8, 2019 11:28
Rotary Encoder Arduino Debounced precise
/* interrupt routine for Rotary Encoders
by rafbuff - thanks whereever u are!
tested with Noble RE0124PVB 17.7FINB-24 https://www.nobleusa.com/pdf/xre.pdf - available at pollin.de
and a few others, seems pretty universal
The average rotary encoder has three pins, seen from front: A C B
Clockwise rotation A(on)->B(on)->A(off)->B(off)
CounterCW rotation B(on)->A(on)->B(off)->A(off)
and may be a push switch with another two pins, pulled low at pin 8 in this case