Skip to content

Instantly share code, notes, and snippets.

@i5ar
i5ar / keymap.rb
Created July 6, 2022 11:35
PRK Firmware Keymap
# Initialize a Keyboard
kbd = Keyboard.new
# You can make right side the "anchor" (so-called "master")
# Initialize GPIO assign
kbd.init_pins(
[6, 7], # row0, row1, etc.
[9, 10] # col0, col1, etc.
)
#keyboard.row_pins = (board.GP6, board.GP7)
@i5ar
i5ar / togglechange.js
Last active April 3, 2021 13:44
Close/open or change division in React
const {name} = evt.target;
if (name === "isLayouts" || name === "isHousing") {
this.setState(s => {
const stateKeys = Object.keys(s);
const index = stateKeys.indexOf(name);
if (index !== -1) stateKeys.splice(index, 1);
return stateKeys.map(
key => ({
[key]: false
})).reduce(
@i5ar
i5ar / README.md
Last active March 28, 2021 17:36
Parrot 60

Parrot Mechanical Keyboard

Preamble

Parrot 60 is a mechanical keyboard based on the Parrot physical layout and the Parrot function layer.
Parrot 60 ANSI is a mechanical keyboard based on the ANSI physical layout and the Parrot function layer.

Every reputable pirate has a Parrot...

Layers

@i5ar
i5ar / rename.py
Last active September 5, 2020 02:40
Rename DJI images
#!/usr/bin/env python3
# ________ ____ ____ _____ ___ ___
# / ___/ _ \/ __ \/ __ `/ __ `__ \/ _ \
# / / / __/ / / / /_/ / / / / / / __/
# /_/ \___/_/ /_/\__,_/_/ /_/ /_/\___/
"""
Replace a character from 'old' to 'new' at specific 'index'
@i5ar
i5ar / main.js
Created May 16, 2020 16:24
Update user field from email
jQuery(document).ready(function($) {
$("input#user_email").keyup(function () {
console.log(this.value);
$("input#user_login").val(this.value.split('@')[0])
});
});
@i5ar
i5ar / index.html
Created April 10, 2020 19:30
Basic Routing with React Router
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Basic Routing</title>
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-router-dom@5.1.2/umd/react-router-dom.min.js"></script>
@i5ar
i5ar / csvmkdir.py
Last active January 28, 2020 22:31
Make directories from a CSV file
#!/usr/bin/env python
# __ __
# ___________ ______ ___ / /______/ (_)____
# / ___/ ___/ | / / __ __ \/ //_/ __ / / ___/
# / /__(__ )| |/ / / / / / / < / /_/ / / /
# \___/____/ |___/_/ /_/ /_/_/|_|\____/_/_/
"""
Make directories from a CSV file.
@i5ar
i5ar / README.md
Last active November 2, 2019 00:33
VS Code extensions and configuration

Manage extensions

Command line extension management for VS Code.

List extensions

List the extensions by running code --list-extensions.

Save the extensions in a file by running code --list-extensions > extensions.vsix.

@i5ar
i5ar / README.rst
Last active August 11, 2019 15:58
Template language

Fox

Fox template language.

Features

What makes Fox template language special.

@i5ar
i5ar / .eslintrc
Last active July 11, 2019 10:41
ESLint, stylelint Run Commands
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:jsx-a11y/recommended",