Skip to content

Instantly share code, notes, and snippets.

View agat's full-sized avatar

Aleksej Romanovskij agat

View GitHub Profile
@ZanzyTHEbar
ZanzyTHEbar / resizer.tsx
Last active April 28, 2024 19:17
Resizing Component in SolidJS
import { throttle } from '@solid-primitives/scheduled'
import {
splitProps,
createSignal,
createEffect,
onCleanup,
JSXElement,
type Component,
type ComponentProps,
children,
@ShoOgino
ShoOgino / index.html
Created March 13, 2023 13:46
Resizable Sidebar
<div class="container">
<aside id="sidebar"></aside>
<div class="resize-handle--x" id="resize-handle" data-target="aside"></div>
<main></main>
</div>
@estorgio
estorgio / prettier-eslint-precommit.md
Last active August 11, 2024 22:13
Setting up Prettier and ESLint with pre-commit hook

Setting up Prettier and ESLint with pre-commit hook

  • Initialize Git repository
    git init
  • Create .gitignore file and add the following:
    node_modules/
    *.env
    
@agat
agat / .flowconfig
Last active September 9, 2018 10:21 — forked from daniele-zurico/.flowconfig
Flow config file for React Native
[ignore]
.*/node_modules/fbjs/.*
[options]
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
[untyped]
.*/node_modules/.*
@Machy8
Machy8 / jquery.on.js
Last active April 6, 2024 13:07
jQuery .on() alternative in pure javascript (this handles events on dynamically added elements) 😎
/**
* @param {string} eventType
* @param {string} selector
* @param {function} callback
*/
function on(eventType, selector, callback) {
document.body.addEventListener(eventType, function (event) {
if (event.target.matches(selector)) {
callback.call(event.target);
}
@SilentImp
SilentImp / trashCSSLoader.js
Last active December 4, 2017 07:43
Это сверх-трешевый способ асинхронной загрузки CSS, который Google Page Speed не видит в принципе.
function trashCSSLoader(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.onload = function (response) {;
applyCSS(response.target.responseText);
};
xhr.send();
}
function applyCSS(css) {
var styles = document.createElement('style');
@markerikson
markerikson / ReactControlledInputWithState.jsx
Created August 2, 2017 02:53
React controlled input with internal state example
class ControlledInputWithInternalState extends Component {
constructor(props) {
super(props);
this.state = {
isValid : true,
value : props.value
};
}
@matthewjberger
matthewjberger / notes.md
Last active March 11, 2024 10:21
How to make an electron app using Create-React-App and Electron with Electron-Builder.
@barretts
barretts / css-filter-generator-to-convert-from-base-hex-color-to-target-hex-color.markdown
Last active March 26, 2021 09:15
CSS filter generator to convert from black to target hex color