Skip to content

Instantly share code, notes, and snippets.

View andi1984's full-sized avatar
🏠
Working from home

Andreas Sander andi1984

🏠
Working from home
View GitHub Profile
RE: WHEN WILL WEB BROWSERS BE COMPLETE?
2020-10-31 02:46PM
A follow-up.
There has been some great conversation around the opinion piece. Having read all
200+ comments on YCombinator and Gist GitHub, I think it's most productive to
respond to them all in this follow-up piece.
The piece will be structured by looking at what I think are the most relevant
critiques and comments, followed by adding context to others' comments, and
@rometsch
rometsch / BH456A_linux_driver.md
Last active October 16, 2023 08:16
MPOW BH456A Bluetooth USB Adapter Kernel Module Adjustements (Realtek RTL8761B chip)

Problem

The MPOW Bluetooth 5 dongle (Model: BH456A) does not work out of the box on Ubuntu 20.04 (kernel 5.4.0-42).

Solution

Patch the bluetooth kernel module and copy the firmware binaries to /lib/firmware.

Copy the fimware

@StevenLangbroek
StevenLangbroek / recs.md
Last active December 3, 2019 17:51
Berlin Recommendations for ReactDay 2019 Attendees

So, you think you can Berlin?

You can! You don't need my help, but here's some places I love love love in Berlin. I'll try to focus on the area around the venue, but travelling within the inner ring of Berlin is easy, fast and safe (if you disagree please let me know, let's talk and revise with some specific recommendations).

Food (these all have veggie & vegan options unless otherwise indicated)

@didichanoch
didichanoch / sample-discord-coc.md
Last active May 19, 2023 17:23 — forked from annalee/sample-slack-coc.md
A sample code of conduct for discord servers.

[DISCORD SERVER] Code of Conduct

Welcome!

[BRIEF DESCRIPTION OF THE DISCORD SERVER AND ITS PURPOSE]

The current admins are:

  • [NAMES]
@ebidel
ebidel / feature_detect_es_modules.js
Last active September 4, 2023 13:56
Feature detect ES modules: both static import and dynamic import()
<!--
Complete feature detection for ES modules. Covers:
1. Static import: import * from './foo.js';
2. Dynamic import(): import('./foo.js').then(module => {...});
Demo: http://jsbin.com/tilisaledu/1/edit?html,output
Thanks to @_gsathya, @kevincennis, @rauschma, @malyw for the help.
-->
@andkirby
andkirby / slack.sh
Last active April 4, 2024 17:51
Shell/Bash script for sending slack messages.
#!/usr/bin/env bash
####################################################################################
# Slack Bash console script for sending messages.
####################################################################################
# Installation
# $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack
# $ chmod +x /usr/bin/slack
####################################################################################
# USAGE
# Send message to slack channel/user
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 9, 2024 19:42
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@nybblr
nybblr / 1-easy.js
Last active July 13, 2022 03:40
3 examples of using Async Generators and Async Iteration in JavaScript!
// Create a Promise that resolves after ms time
var timer = function(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
};
// Repeatedly generate a number starting
// from 0 after a random amount of time
var source = async function*() {

Parens And Performance

Years ago, some smart folks that worked on JS engines realized that not all JS that's loaded into a page/app initially is needed right away. They implemented JIT to optimize this situation.

JIT means Just-In-Time, which means essentially that the engine can defer processing (parsing, compiling) certain parts of a JS program until a later time, for example when the function in question is actually needed. This deferral means the engine is freer to spend the important cycles right now on the code that's going to run right now. This is a really good thing for JS performance.

Some time later, some JS engine devs realized that they needed to get some hints from the code as to which functions would run right away, and which ones wouldn't. In technical speak, these hints are called heuristics.

So they realized that one very common pattern for knowing that a function was going to run right away is if the first character before the function keyword was a (, because that usually m