Skip to content

Instantly share code, notes, and snippets.

@disco0
disco0 / macmini 1,1 to 2,1 EFI firmware update.md
Last active October 12, 2025 06:48 — forked from dreamcat4/macmini 1,1 to 2,1 EFI firmware update
macmini 1,1 to 2,1 EFI firmware update

Mac Mini 1,1 to 2,1 Firmware Upgrade

  • NOTE: This is a markdown adaptation of the original forked gist, additional file in this gist is an adaptation of the original post.

Guide & Discussion Thread:

For the best guide, use search keyword: chmod. It should scroll down to:

@disco0
disco0 / index.pug
Last active September 20, 2020 08:57 — forked from zeddash/index.pug
Medium style lazy loading images with react #codepen #react
div#app
@disco0
disco0 / asyncwhile.js
Created October 4, 2020 08:08 — forked from tyler-johnson/asyncwhile.js
Asynchronous while loop for ES6 Promises.
function asyncWhile(condition, action, ctx) {
var whilst = function(data) {
return condition.call(ctx, data) ?
Promise.resolve(action.call(ctx, data)).then(whilst) :
data;
}
return whilst();
}
@disco0
disco0 / readme.md
Created October 9, 2020 04:04 — forked from EthanRutherford/readme.md
Regex but better

RegexButBetter

changes:

  • whitespace is no longer meaningful, and can therefore be used for formatting
    • this means whitespace must be escaped, using existing constructs like \n, \t, and a new escape for singleSpace \ (exact recipe open for discussion)
  • (capture) group constructs are totally rearranged, to allow for easier non-capturing grouping and reduction of "symbol soup" of current regex patterns
    • non-capturing group is assigned the bare ( so that the easiest-to-type grouping construct does not capture, and pollute the capture result array
      Motivation: using (?: just to be able to | a few options looks nasty
    • lookahead and lookbehind are modified to remove inconsistencies that exist for legacy, backward-compatibility reasons
  • (>= = positive lookahead
@disco0
disco0 / 1.md
Created October 15, 2020 01:44 — forked from getify/1.md
BetterPromise: a strawman experiment in subclassing Promise and "fixing" a bunch of its awkward/bad parts

Some things that are "better" with this BetterPromise implementation:

  • BetterPromise # then(..) accepts a BetterPromise (or Promise) instance passed directly, instead of requiring a function to return it, so that the promise is linked into the chain.

    var p = BetterPromise.resolve(42);
    
    var q = Promise.resolve(10);
    
    p.then(console.log).then(q).then(console.log);
@disco0
disco0 / primitive-types-proxy-and-decorator.ts
Created October 15, 2020 01:59 — forked from mmichlin66/primitive-types-proxy-and-decorator.ts
Virtualizing TypeScript Properties with Proxy and Decorator - listing 6
// @virtual decorator function
function virtual( target: any, name: string)
{
// symbol to keep the proxy handler value
let sym = Symbol( name + "_proxy_handler");
Object.defineProperty( target, name, {
enumerable: true,
get()
@disco0
disco0 / virtualizing-numbers.ts
Created October 15, 2020 01:59 — forked from mmichlin66/virtualizing-numbers.ts
Virtualizing TypeScript Properties with Proxy and Decorator - listing 5
class Base
{
@virtual a = 1;
b = this.a;
}
class Derived extends Base
{
a = 2;
}
@disco0
disco0 / proxy-and-decorator.ts
Created October 15, 2020 01:59 — forked from mmichlin66/proxy-and-decorator.ts
Virtualizing TypeScript Properties with Proxy and Decorator - listing 4
export function virtual( target: any, name: string)
{
// symbol to keep the proxy handler value
let sym = Symbol( name + "_proxy_handler");
Object.defineProperty( target, name, {
enumerable: true,
get()
{
@disco0
disco0 / virtualizing-with-proxy.ts
Created October 15, 2020 02:00 — forked from mmichlin66/virtualizing-with-proxy.ts
Virtualizing TypeScript Properties with Proxy and Decorator - listing 3
class VirtHandler
{
target: any;
get( t: any, p: PropertyKey, r: any): any
{
return this.target[p];
}
}
@disco0
disco0 / virtualizing-with-function.ts
Created October 15, 2020 02:00 — forked from mmichlin66/virtualizing-with-function.ts
Virtualizing TypesScript Class Properties with Proxy and Decorator - listing 2
class Base
{
first = { v: 1 };
second = () => this.first;
}
class Derived extends Base
{
first = { v: 2 };
}