Skip to content

Instantly share code, notes, and snippets.

View abdulhannanali's full-sized avatar
💭
WUNDERWALL!!!!

Hannan Ali abdulhannanali

💭
WUNDERWALL!!!!
View GitHub Profile
function eventTarget(o) {
const {port1} = new MessageChannel();
o.dispatchEvent = port1.dispatchEvent.bind(port1);
o.addEventListener = port1.addEventListener.bind(port1);
}
// Usage:
let myObj = { /* ... */ };
eventTarget(myObj);
@xahare
xahare / Docker-on-qubes.md
Last active April 3, 2024 12:43
How to run docker on Qubes-OS
@shospodarets
shospodarets / Chrome headless Puppeteer- capture DOM element screenshot using
Last active January 17, 2023 18:52
Chrome headless Puppeteer- capture DOM element screenshot using
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Adjustments particular to this page to ensure we hit desktop breakpoint.
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1});
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'});
@josteink
josteink / on_stateful_code.txt
Last active October 21, 2020 05:37
On why stateful code is bad
On why stateful code is bad
===========================
STUDENT: Sir, can I ask a question?
TEACHER: Yes!
STUDENT: How do you put an elephant inside a fridge?
TEACHER: I don't know.
STUDENT: It's easy, you just open the fridge and put it in. I have another question!
TEACHER: Ok, ask.
STUDENT: How to put a donkey inside the fridge?
anonymous
anonymous / yo
Created February 24, 2016 01:35
Adding some text
I can add some text in here
@abdulhannanali
abdulhannanali / nodeapplicationideas.md
Last active December 27, 2015 19:32
These are some node express application ideas for this task in Google Code In. I will work on one of them. https://codein.withgoogle.com/dashboard/task-instances/6528011029446656/?sp-page=1

Some ideas for the node application I have to develop

  1. Students who code a site for under 17 girls and boys to know more about coding in an interactive way with all the goodness of open source included.

    Pros

    • Everything pro about it
@KyleAMathews
KyleAMathews / lambda.md
Last active May 13, 2022 00:49
Using Kafka and a Samza-like node.js architecture

Disclaimer

I'm still very new to Kafka, eventsourcing, stream processing, etc. I'm in the middle of building my first production system with this stuff and am writing this at the request of a few folks on Twitter. So if you do have experience, please do me and anyone else reading this a favor by pointing out things I get wrong :)

Inspirations

@ericelliott
ericelliott / react-reusable-component.md
Last active December 26, 2022 07:05
React - Complete Reusable Component

React Reusable Component Factory

'use strict';

const ENTER_KEY = 13;

const emailFactory = function ({
  React,
  setEmail,
@jwill
jwill / MemeMaker.html
Last active January 23, 2024 23:33
Starter code for Meme Maker
<!DOCTYPE html>
<html>
<head>
<title>MemeMaker-Simple</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<style>