Skip to content

Instantly share code, notes, and snippets.

View hputzek's full-sized avatar
😎
Whaddup?

Hendrik Putzek hputzek

😎
Whaddup?
View GitHub Profile
@hputzek
hputzek / add_git_alias.sh
Last active February 23, 2024 11:47
wbranch git alias
git config --global alias.wcb '!f() { branch_name=$1; if git show-ref --verify --quiet refs/heads/$branch_name; then echo "Branch $branch_name already exists in the current repository."; else git checkout -b $branch_name; fi; new_branch=$branch_name; cd ./base; if git show-ref --verify --quiet refs/heads/$new_branch; then echo "Branch $new_branch already exists in the base repository."; else git checkout -b $new_branch; fi; }; f'
git config --global alias.wco '!f() { branch_name=$1; if git show-ref --verify --quiet refs/heads/$branch_name; then git checkout $branch_name; else echo "Branch $branch_name does not exist in the current repository."; fi; new_branch=$branch_name; cd ./base; if git show-ref --verify --quiet refs/heads/$new_branch; then git checkout $new_branch; else echo "Branch $new_branch does not exist in the base repository."; fi; }; f'
git config --global alias.wp '!f() { branch_name=$1; if git show-ref --verify --quiet refs/heads/$branch_name; then git push origin $branch_name; else echo "Branc
@hputzek
hputzek / nodeVersionCheck.js
Last active May 20, 2021 10:20
Check major node version before npm install
/**
* This script must execute before "npm install"
* Lock the major version of Node running based on the one set in the package.json
* Works by setting a major version in package.json (e.g. "14" or "15"....) in the "engines.node" section.
*/
const path = require("path");
const packageJson = require(path.join(process.cwd(), "package.json"));
const requiredNodeVersion = parseInt(packageJson.engines.node);
@hputzek
hputzek / main.cpp
Created May 23, 2020 08:34
Led Tester
/**
* TPM2 Example
* with the FastLED library
*
* Copyright (c) 2019 Stephan Ruloff
* https://github.com/rstephan/TPM2
*
* GPL v2 only
*/
@hputzek
hputzek / potential-frame-schema.js
Last active April 2, 2020 19:17
potential-frame-schema.js (Pixelcrasher/pusher)
// This is a potential structure for a frame object
const exampleFrame = {
'controllerId': {
// Pixelpusher knows how to process this from the controller metadata
// alternative 1: Put each pixel in an array, if the array has length of 3
// it means RGB, if length===4 it means RGBW
'channelId': [[255,0,0], [0,0,0,255], ['more pixels here...']],
// alternative 2: send one big array of r/g/b(w) values
@hputzek
hputzek / index.html
Created February 24, 2020 22:17
webserial connect
<!DOCTYPE html>
<html lang="en">
<head>
<title>Parcel Sandbox</title>
<meta charset="UTF-8" />
</head>
<body>
<button id="portSelect" type="button">Select a port</button>
@hputzek
hputzek / butterImageProcessing.js
Last active July 16, 2018 20:10
Processing images with buttercms - for more details refer to https://buttercms.com/docs/api/#image-api
/* example options:
teaserImageConfig: [
{
resize:
{
width: '420',
height: '420',
fit: 'crop'
},
@hputzek
hputzek / open-url.sh
Last active August 4, 2017 10:27
Open an url in windows default browser from linux subsystem
# Open google from windows linux subsystem
# This gist will be extended to check for the platform its running on and adapt accordingly
echo "cmd.exe /C start http://www.google.de"