Skip to content

Instantly share code, notes, and snippets.

View djalmajr's full-sized avatar

Djalma Júnior djalmajr

View GitHub Profile
@marcpinet
marcpinet / README.md
Last active June 26, 2024 22:25
Activate Sublime Text 4 Build 4143 and below for ever (also maybe above, but not yet tried)

Activate Sublime Text (for ever)

  1. Go to https://hexed.it/
  2. Click Open File in the top left corner and select sublime_text.exe
  3. Press CTRL + F or on the Search for bar in the left panel and look for: 80 78 05 00 0f 94 C1
  4. Now in the editor, click on the first byte (80) and start replacing each byte by: C6 40 05 01 48 85 C9
  5. Finally, in the top left corner again, click on Save as and replace the old executable file with the newly created one.

Enjoy an Unlimited User License!

@IrvingArmenta
IrvingArmenta / forwardref-generics-18.ts
Created October 2, 2022 02:50
Example of a forward ref generic component in React 18
import React, { ForwardedRef, forwardRef, MouseEvent } from 'react';
type ClickableListProps<T> = {
items: T[];
onSelect: (
item: T,
event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>,
) => void;
};
@HoussemNasri
HoussemNasri / BalsamiqForever.py
Last active July 5, 2024 16:28
Extend your trial period for Balsamiq Wireframes on Windows and macOS Forever!
import json
import os
import time
import webbrowser
import sys
import re
def handleWindows(extra_seconds):
print("OS : Windows")
// WARNING: There's much more to know/do around hooks, and
// this is just a simplification of how these work.
// shared references, updated
// per each hook invoke
let execution = null;
let current = null;
let context = null;
let args = null;
const {isArray} = Array;
const sync = async values => {
for (let {length} = values, i = 0; i < length; i++) {
const value = await values[i];
values[i] = isArray(value) ? await sync(value) : value;
}
return values;
};
function useState(value) {
const {caller} = arguments.callee;
const {arguments: a} = caller;
const {stack} = useState;
if (!stack.has(caller))
stack.set(caller, {a, i: 0, s: []});
const state = stack.get(caller);
state.a = a;
const {i, s} = state;
if (i === s.length) {
@WebReflection
WebReflection / attr.js
Created November 19, 2020 19:38
A dataset like behavior for any attribute
const proxies = new WeakMap;
const hyphen = name => name.replace(/([a-z])([A-Z])/g, '$1-$2');
const handler = {
get: (el, name) => el.getAttribute(hyphen(name)),
set: (el, name, value) => {
el.setAttribute(hyphen(name), value);
return true;
}
};
const set = el => {

What's SWR?

It's React Hooks for Remote Data Fetching, a hook designed to render data on demand.

import useSWR from 'swr'

function Profile() {
  const { data, error } = useSWR('/api/user', fetcher);
@WebReflection
WebReflection / uce-vs-lit-element.md
Last active January 8, 2024 07:16
A very simple comparison table between uce and lit-element.

A very simple comparison table between these two libraries.

uce lit-element
version 1.11.9 2.4.0
license ISC (simplified MIT) BSD-3-Clause License
language JS w/ TS definition TS w/ JS transpilation
size ( brotli ) 9437b ES5 / 6811b ES2015+ 8634b ES5 / 6708b ES2015+
@WebReflection
WebReflection / fe-vs-be.md
Last active March 27, 2021 19:51
Front End vs Back End in a nutshell.

FE vs BE

TL;DR enough of this kind of nonsense


I've been in the field for ~20 years and started as BE developer, and this is a reference for people thinking that because they are on the BE side, they're somehow entitled to:

  • earn more money
  • feel superior about FE developers
  • joke about JavaScript or minimize the FE effort in any way