Skip to content

Instantly share code, notes, and snippets.

🤔
...

Ahmed El Gabri ahmedelgabri

🤔
...
Block or report user

Report or block ahmedelgabri

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ipad-dev.md

Essential Apps

  • Blink: Install Blink on your iPad
  • Tailscale: Install Tailscale on all your devices.
  • mosh: Install mosh on all your devices. It comes with Blink by default.

Nice to have apps

Amphetamine for Mac

@techtheriac
techtheriac / lambdajs.md
Last active Jun 1, 2020
A subtle introduction to Lambda Calculus for the JavaScript Developer
View lambdajs.md

Lambda (λ) Calculus For Javascript Developers

This article aims at explaining lambda calculus in a more approachable less 'mathy' manner.

Terms That Are Good To Know

  • Memoization: Memoization is an optimization technique used primarily to speed up computer programs by caching the result of expensive function calls and returning the cached result when fed with the same input.

  • Pure Function: A pure function is a function whose computation does not depend on globally declared variables, it does no I/O or mutations. All it does is return a value after doing a bunch of computations on the arguments it recieves. For a given set of arguments, a pure function will always return the same value. Thus, a pure function is one that is memoizable.

@developit
developit / *tiny-array-flat-polyfill.md
Last active Apr 11, 2020
140b polyfill for Array.prototype.flat() and Array.prototype.flatMap(). https://npm.im/tiny-array-flat-polyfill
View *tiny-array-flat-polyfill.md

140b polyfill for [].flat() & [].flatMap()

Install: npm i tiny-array-flat-polyfill

Usage:

import 'tiny-array-flat-polyfill';

const ARR = [1, [2, [3]], [[[4]]], 5]
@busypeoples
busypeoples / RemoteData.tsx
Created Mar 6, 2020
RemoteData implementation using React, hooks and TypeScript
View RemoteData.tsx
import React, { useState } from "react";
type NotAsked = {
_type: "NOT_ASKED";
};
type Loading = {
_type: "LOADING";
};
@WebReflection
WebReflection / handle-event-doodle.md
Last active May 26, 2020
The `handleEvent` ASCII doodle
View handle-event-doodle.md

About This Gist

This gist summarizes the handleEvent(event) pattern features, something standard, something described by me many times, written in my tiny book, tweeted about, and yet it's something most Web developers ignore.

The handleEvent ASCII Doodle

                  ┌---------------------------------┐
var handler = {   | any object that inherits or     |
@sophiebits
sophiebits / reducer-with-effects.js
Last active Feb 26, 2020 — forked from davidkpiano/reducer-with-effects.js
An idea for actor-model-based effects with reducers
View reducer-with-effects.js
import {
useReducerWithEffects,
emitEffect,
} from 'react';
// In a component
const UserComponent = () => {
function fetchUserEffect(id, parentRef) {
const controller = new AbortController();
@yegappan
yegappan / VimScriptForPythonDevelopers.MD
Last active Jun 1, 2020
Vim script for Python Developers
View VimScriptForPythonDevelopers.MD

Vim Script for Python Developers

A guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with programming in Python.

For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way

For a similar guide for JavaScript developers, refer to Vim Script for the JavaScripter

This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, key-mapping, [abbrevi

View shape-generics.ts
interface Circle {
type: 'circle';
radius: number;
}
interface Square {
type: 'square';
width: number;
}
@IanColdwater
IanColdwater / twittermute.txt
Last active Jun 1, 2020
Here are some terms to mute on Twitter to clean your timeline up a bit.
View twittermute.txt
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@lencioni
lencioni / array.includes.js
Last active Feb 17, 2020
Webpack module replacements for shims/polyfill packages
View array.includes.js
module.exports = function arrayIncludes(arr, search, fromIndex) {
return arr.includes(search, fromIndex);
};
You can’t perform that action at this time.