Skip to content

Instantly share code, notes, and snippets.

View vlrmprjct's full-sized avatar
🎹
Boing boom tschak!

Thomas vlrmprjct

🎹
Boing boom tschak!
View GitHub Profile
@vlrmprjct
vlrmprjct / .zshrc
Last active February 5, 2024 16:09
OhMyZSH Custom Configuration
# path needs to be set before oh-my-zsh is loaded
export PATH=~/.npm-global/bin:$PATH
export PATH=~/.npm/bin:$PATH
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
export PATH=$PATH:"/home/thomas/bin"
export NVM_DIR="$HOME/.nvm"
# load nvm
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
@vlrmprjct
vlrmprjct / change_user_after_commit.sh
Last active November 5, 2023 09:50
Useful GIT commands #git
git commit --amend --author="John Doe <john@doe.org>"
@vlrmprjct
vlrmprjct / counter.ino
Created July 31, 2020 07:33
Arduino Simple Counter
/* Simple Counter
* ——————
*
* This is a simple counter that takes a digital input
*
*/
int ledPin = 13; // choose the pin for the LED
int switchPin =2; // choose the input pin (for a pushbutton)
int val = 0; // variable for reading the pin status
int counter = 0;
@vlrmprjct
vlrmprjct / delaytime.ino
Created January 25, 2023 17:03
Arduino
boolean delayTime(unsigned long time) {
static unsigned long previousmillis = 0;
unsigned long currentmillis = millis();
if (currentmillis - previousmillis >= time) {
previousmillis = currentmillis;
return true;
}
return false;
}
@vlrmprjct
vlrmprjct / avgLoad.js
Created October 5, 2021 14:47 — forked from GaetanoPiazzolla/avgLoad.js
% CPU in Node.JS
const os = require("os");
//Create function to get CPU information
function cpuAverage() {
//Initialise sum of idle and time of cores and fetch CPU info
var totalIdle = 0, totalTick = 0;
var cpus = os.cpus();
//Loop through CPU cores
@vlrmprjct
vlrmprjct / index.html
Created June 26, 2022 06:43 — forked from lillylangtree/index.html
sample index.html file
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Spoon-Knife</title>
<LINK href="styles.css" rel="stylesheet" type="text/css">
</head>
<body>
@vlrmprjct
vlrmprjct / js.code-snippets
Last active May 31, 2022 05:55
VSCode ui snippets & tasks #vscode #snippets #javascript #typescript
{
"Log to console (String)": {
"scope": "javascript,typescript,javascriptreact,typescriptreact",
"prefix": "#log",
"body": [
"console.log('$1');",
"$0"
],
"description": "Log to the console (String)"
},
@vlrmprjct
vlrmprjct / task.json
Last active January 21, 2022 05:39
VSCode run multiple build task
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
// **************************************************
// USING:
// npm install node-sass -g
// npm install uglify-js -g
// npm install html-minifier -g
// **************************************************
{
"version": "2.0.0",
@vlrmprjct
vlrmprjct / gps_speed.ino
Last active October 17, 2021 14:59
GPS Speed Arduino Pro Micro #gps #arduino #promicro #attiny1634 #rx #tx #speedometer
// GPS Speedometer
// Copyright (c) 2021 Thomas Meschke
//
// MIT License
// https://opensource.org/licenses/mit-license.php
//
// Put the GPS Module ( NEO-6M-x ) on the following pins:
// TX: Arduino Pro Micro / ATTINY 1634 => RX Pin
// RX: Arduino Pro Micro / ATTINY 1634 => TX Pin
//
const pos = { x: 0, y: 0 };
const zoom_target = { x: 0, y: 0 };
const zoom_point = { x: 0, y: 0 };
const factor = 0.1;
const max_scale = 3;
let scale = 1;
const scrolled = (e) => {
const size = {