Skip to content

Instantly share code, notes, and snippets.

View 32teeth's full-sized avatar
:octocat:
Get it done. Right.

Eugene Andruszczenko 32teeth

:octocat:
Get it done. Right.
View GitHub Profile
@32teeth
32teeth / colors.sh
Created October 9, 2024 17:46
Color Generator
IndianRed=''
LightCoral=''
Salmon=''
DarkSalmon=''
LightSalmon=''
Crimson=''
Red=''
FireBrick=''
DarkRed=''
Pink=''
@32teeth
32teeth / console.js
Created October 2, 2024 18:18
Mynah-UI Console Test
const removeAllTabs = () => {
const tabs = mynahUI.getAllTabs();
Object.keys(tabs).forEach(key => mynahUI.removeTab(key, mynahUI.lastEventId));
};
const createTabs = (count) => {
const addTabButton = document.querySelector('.mynah-ui-icon.mynah-ui-icon-plus');
for (let i = 0; i < count; i++) {
addTabButton.click();
}
@32teeth
32teeth / convert_html_case.sh
Created September 27, 2024 11:53
HTML uppercase to lowercase
#!/bin/bash
# Check if directory is provided
if [ -z "$1" ]; then
echo "Usage: $0 <directory>"
exit 1
fi
DIRECTORY="$1"
@32teeth
32teeth / battery_polarity_detection.v
Created September 20, 2024 21:40
Battery Reverse Detect
module battery_polarity_detection (
input wire pos_pin,
input wire neg_pin,
output reg battery_ok,
output reg reverse_detected,
inout wire battery_pin1,
inout wire battery_pin2
);
reg polarity_correct;
/**
* Ask clarifying questions:
* - What types of input are we expecting (valid HTML strings)?
* - What should happen in the event of invalid or non-HTML inputs?
* - Should we focus solely on HTML or handle any generic XML/HTML-like string input?
*
* Analyze various solutions and tradeoffs:
* - We could use `DOMParser()` to parse the HTML and detect structural errors.
* - Alternative methods like regular expressions are not suitable for parsing HTML due to its complexity.
@32teeth
32teeth / mypy.ini
Created August 19, 2024 20:27
mypy ini file (generic)
# mypy.ini
[mypy]
python_version = 3.10
strict = True
warn_unused_ignores = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unreachable = True
show_error_codes = True
@32teeth
32teeth / challenge.c
Last active July 8, 2024 22:10
CODE100 - GSM-7 or UCS-2
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#define GSM7_BITSET_SIZE 32 // 256 / 8
unsigned char gsm7_bitset[GSM7_BITSET_SIZE] = {0};
void init_gsm7_bitset() {
const char *gsm7_chars = "@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞ\x1BÆæßÉ "
"!\"#¤%&'()*+,-./0123456789:;<=>?"
@32teeth
32teeth / appDelegate.h
Created February 20, 2016 14:01
switch between view controllers without segues
/*
** in your header, define a reference
*/
- (void)switchViewController:(UIViewController*)view :(NSString*)segue;
@32teeth
32teeth / variables.css
Created March 29, 2024 00:31
CSS Variables: Used as a CDN for multiple projects
:root {
--scale-0: 1rem;
--scale-1: 1.125rem;
--scale-2: 1.25rem;
--scale-3: 1.5rem;
--scale-4: 1.875rem;
--scale-5: 2.25rem;
--scale-6: 3rem;
--scale-7: 3.75rem;
--scale-8: 4.5rem;
# Update your EV2 Amazon Linux box to whatever version you want
sudo apt purge nodejs npm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
nvm install node
source ~/.bashrc
nvm install latest
# LIVE THE DREAM