Skip to content

Instantly share code, notes, and snippets.

View marcelreppi's full-sized avatar

Marcel Reppenhagen marcelreppi

View GitHub Profile
@marcelreppi
marcelreppi / windows-style-key-mapping-private-keyboard.json
Last active January 17, 2022 09:07
windows-style-key-mapping-private-keyboard.json
{
"title": "Additional keymappings for RAPOO Keyboard",
"rules": [
{
"description": "Swap left command with left option",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_command",
{
"title": "Windows-style keyboard mapping",
"rules": [
{
"description": "Application and tab switching",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "tab",
@marcelreppi
marcelreppi / pre-commit
Last active January 9, 2021 13:24
Git pre-commit hook to prevent push to master/main
#!/bin/sh
protected_branches="master main"
policy="\n\n[Policy] Never commit code directly to the "$protected_branch" branch! (Prevented with pre-commit hook.)\n\n"
current_branch=$(git rev-parse --abbrev-ref HEAD)
do_exit() {
echo -e $policy
@marcelreppi
marcelreppi / setup-eslint.sh
Last active January 6, 2020 20:22
Create local eslint setup
npx install-peerdeps --dev eslint-config-airbnb-base
npm install --dev eslint-config-prettier eslint-plugin-prettier prettier babel-eslint
cat > .eslintrc << EOF
{
"extends": [
"airbnb-base",
"plugin:prettier/recommended"
],
"env": {
"node": true,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marcelreppi
marcelreppi / .prettierrc
Created March 23, 2019 13:29
Personal prettier settings
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": false
}
@marcelreppi
marcelreppi / .eslintrc
Last active March 23, 2019 13:30
Personal eslint settings
{
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 2018
},
"env": {
"es6": true,
"node": true,
// Generic double ended queue
function DoubleEndedQueue() {
this.first
this.last
this.length = 0
}
DoubleEndedQueue.prototype.push = function (value) {
const newNode = new Node(value)
@marcelreppi
marcelreppi / index.html
Created January 2, 2019 18:24
Tile moving game
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/addons/p5.dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/addons/p5.sound.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="canvas-container"/>
<script src="sketch.js"></script>
function longestCommonSubsequence(a, b) {
function checkSubstring(a, b, startIdx, length) {
if (longestCommonSubsequence !== '' || startIdx == a.length) {
return
}
if (startIdx + length > a.length) {
checkSubstring(a, b, 0, length - 1)
return
}