Skip to content

Instantly share code, notes, and snippets.

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

Thomas vlrmprjct

:octocat:
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 / 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 / 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 / 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
//
@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
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 = {
@vlrmprjct
vlrmprjct / force-scrollbars-visible.css
Created March 1, 2021 20:36 — forked from IceCreamYou/force-scrollbars-visible.css
Mac OS X hides scrollbars by default. This is annoying for UI design because it means users might not realize that certain areas are scrollable. This public domain Gist forces the scrollbar to always be visible with native behavior in Webkit-based browsers (Chrome and Opera) on Macs.
.force-show-scrollbars ::-webkit-scrollbar-track:vertical {
border-left: 1px solid #E7E7E7;
box-shadow: 1px 0 1px 0 #F6F6F6 inset, -1px 0 1px 0 #F6F6F6 inset;
}
.force-show-scrollbars ::-webkit-scrollbar-track:horizontal {
border-top: 1px solid #E7E7E7;
box-shadow: 0 1px 1px 0 #F6F6F6 inset, 0 -1px 1px 0 #F6F6F6 inset;
}
@vlrmprjct
vlrmprjct / getLocaleDateString.js
Last active December 28, 2020 11:28
Locale Date Formats #javascript #i18n #date #locale
const getLocaleDateString = (locale) => {
const formats = {
'af-ZA': 'yyyy/MM/dd',
'am-ET': 'd/M/yyyy',
'ar-AE': 'dd/MM/yyyy',
'ar-BH': 'dd/MM/yyyy',
'ar-DZ': 'dd-MM-yyyy',
'ar-EG': 'dd/MM/yyyy',
'ar-IQ': 'dd/MM/yyyy',
'ar-JO': 'dd/MM/yyyy',
@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;