Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View leobalter's full-sized avatar
💭
status

Leo Balter leobalter

💭
status
View GitHub Profile
@leobalter
leobalter / asshole.js
Created May 30, 2011 04:48 — forked from Kilian/annoying.js
How to be an asshole
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*
@leobalter
leobalter / gist:2787933
Created May 25, 2012 12:54
List of languages that compile to JS
# [[Original Link|https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS]]
#### CoffeeScript Family (& Friends)
* [[CoffeeScript|http://jashkenas.github.com/coffee-script/]] Unfancy JavaScript
###### Family (share genes with CoffeeScript)
* [[Coco|https://github.com/satyr/coco]] A CoffeeScript dialect that aims to be more radical and practical, also acts as a test bed for features that get imported in CoffeeScript.
* [[LiveScript|http://gkz.github.com/LiveScript/]] is a fork of Coco that is much more compatible with CoffeeScript, more functional, and with more features.
@leobalter
leobalter / 1-setup.md
Created April 25, 2022 23:35 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

Last updated March 28, 2021

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

--> HELLo!
var x = 2;
var y=42<!--x;
function z() {
return 'a';
}
with (new Proxy(globalThis, {})) {
function z() {
@leobalter
leobalter / _README.md
Last active March 17, 2021 00:35
VSCode terminal focus on off

Current

SuperCall : super Arguments

1. Let newTarget be GetNewTarget().
2. Assert: Type(newTarget) is Object.
3. Let func be ? GetSuperConstructor().
4. Let argList be ? ArgumentListEvaluation of Arguments.
5. Let result be ? Construct(func, argList, newTarget).
var p = Promise.resolve(1).then(v => console.log(v);
console.log(0);
await import('foo');
console.log(2);
p.then(() => console.log(3);
The WeakRef Constructor
https://tc39.github.io/proposal-weakrefs/#sec-weak-ref-constructor
- [ ] is the initial value of the WeakRef property of the global object.
- [ ] is designed to be subclassable. It may be used as the value in an extends clause of a class definition. Subclass constructors that intend to inherit the specified WeakRef behaviour must include a super call to the WeakRef constructor to create and initialize the subclass instance with the internal state necessary to support the WeakRef.prototype built-in methods.
WeakRef ( target )
https://tc39.github.io/proposal-weakrefs/#sec-weak-ref-target
1. [ ] If NewTarget is undefined, throw a TypeError exception.
function uniqBy(iter, mapFn) {
var map = new Map();
for (let item of iter) {
let key = mapFn(item);
// Use the first given key identifier
if (map.has(key)) {
continue;
}
```js
Object.setPrototypeOf(Array.prototype, new Int8Array(0));
const a = [];
a[0] = 4;
console.log(+a[0]);
```
---
`a[0] = 4;`