Skip to content

Instantly share code, notes, and snippets.

🙃
¡Hola!

Oleg Solomka legomushroom

🙃
¡Hola!
Block or report user

Report or block legomushroom

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 Paste Screenshot Demo.md

Paste Screenshot Demo

Paste screenshots from your clipboard into the gist:

  • From context menu: Paste Screenshot command.
  • From command palette: GistPad: Paste Screenshot command.
  • With a shortcut: super + shift + v.

image

View gist:e9c02c864a42bf5a8a0f91d2e0590dba
export const promiseState = async (p: Promise<any>): Promise<string> => {
const t = {};
return await Promise.race([p, t]).then(
(v) => {
return (v === t)
? 'pending'
: 'fulfilled';
},
() => 'rejected');
};
View rotary encoder [COM-09117]
/*
(Copy and paste)
Rotary encoder decoding using two interrupt lines.
Most Arduino boards have two external interrupts,
numbers 0 (on digital pin 2) and 1 (on digital pin 3).
Program sketch is for SparkFun Rotary Encoder sku: COM-09117
Connect the middle pin of the three to ground.
View JS surprises
// ---------------------------------------------------------------------------------------------------------------------------
```javascript
function foo () {
console.log(a);
}
var a = 2;
function bar () {
You can’t perform that action at this time.