Skip to content

Instantly share code, notes, and snippets.

View idfunctor's full-sized avatar
🎯
Focusing

idfunctor idfunctor

🎯
Focusing
  • Whalar
  • Tallinn
  • 03:39 (UTC +03:00)
View GitHub Profile
@eYinka
eYinka / tailwind-radial-progress-bar.txt
Last active April 5, 2025 13:09
Tailwind CSS Radial Progress Bar
// Inspired by Tailwind Daisy UI progress bar: https://daisyui.com/components/radial-progress/
// This is a custom-made progress circular/radial progress bar with centered percentage text.
// Tested with Tailwind 3.x. Should work with lower versions of Tailwind CSS as well.
STEP 1: Add the following custom CSS:
.progress-ring__circle {
transition: stroke-dashoffset 0.35s;
transform: rotate(-90deg);
transform-origin: 50% 50%;

I've recently joined Amazon Dublin from India and got opportunities to interview with Meta London, Zalando Berlin & some other companies. I extensively researched about companies hiring internationally which support visa & relocation for Tech roles. So sharing list of companies:

Do consider to STAR, if it helped you.

London

TL/DR Not every type hole is harmful.

[Disclaimer: The following code is typed with scriptum, a type validator for dynamically typed Javascript. It has its roots in Haskell's Hindley-Milner based type system.]

It helps to consider mutations to get a better intuition. Mutations are a side effect and thus harmful. However, if we manage to hedge side effects so that we don't lose track of them, then we can benefit from the flexibility they provide without having to suffer the consequences.

For mutations this merely essentially means ensuring they stay local. Local mutations are fine in most cases. The same applies to type holes.

Let's work through some code to see if this claim holds. Gradual typing is a trade-off. Good coding means to find the most promising trade-offs.

@OliverJAsh
OliverJAsh / foo.ts
Last active April 30, 2025 05:41
TypeScript: infer function parameter as a tuple, not an array
{
declare const fn: <T>(fn: (t: T) => void, t: T) => void;
fn(
(t) => {
// $ExpectType [number, string]
// ❌
// Actual: (string | number)[)
t;
},
function useAbortController() {
const abortControllerRef = React.useRef()
const getAbortController = React.useCallback(() => {
if (!abortControllerRef.current) {
abortControllerRef.current = new AbortController()
}
return abortControllerRef.current
}, [])
React.useEffect(() => {
@gregbown
gregbown / client-form-rws.js
Created November 11, 2019 18:22
How to use csurf with multipart/form-data example with express, express-fileupload, csurf and jquery + a bit of bootstrap and ejs
/* Form AJAX JavaScript. Requires jQurery to be loaded */
window.DEMO = window.DEMO || {};
/**
* @method rws
* @description RESTful Web services (RWS)
* Wrapped in an IIFE (Immediately Invoked Function Expression)
* @paraam $ {object} jQuery object, used for ajax methods.
*/
// eslint-disable-next-line no-undef
@pbadenski
pbadenski / connect.ts
Created August 23, 2019 09:06
refract-react-redux connect
import React, { Context } from "react";
import {
InferableComponentEnhancerWithProps,
MapDispatchToPropsFunction,
MapStateToProps
} from "react-redux";
import { Aperture, toProps, withEffects } from "refract-rxjs";
import { combineLatest, concat, Observable, of } from "rxjs";
import { auditTime, first, map, startWith } from "rxjs/operators";
import { auditMap, connect as connect_ } from "rxjs-redux";
@Beneboe
Beneboe / how-to-setup-verified-commits.md
Last active July 29, 2025 22:31
How to Setup Verified Commits on Github
import './SwipeableListItem.css'
import React, {useRef, useEffect} from 'react'
function SwipeableListItem(props) {
const listElementRef = useRef()
const wrapperRef = useRef()
const backgroundRef = useRef()
const dragStartXRef = useRef(0)
const leftRef = useRef(0)
@detunized
detunized / index.js
Last active March 1, 2019 21:41
JavaScript solutions profiling
#!/usr/bin/env node --expose-gc
//
// Logest word
//
function findLongestWordLengthForLoop(str) {
let maxVal = 0;
const wordArr = str.split(' ');