Skip to content

Instantly share code, notes, and snippets.

View aelbore's full-sized avatar

Jay aelbore

View GitHub Profile
@ebidel
ebidel / object-observe-proxy-polyfill.js
Last active July 29, 2021 04:08
Object.observe() polyfill using ES6 Proxies (POC)
// An `Object.observe()` "polyfill" using ES6 Proxies.
//
// Current `Object.observe()` polyfills [1] rely on polling
// to watch for property changes. Proxies can do one better by
// observing property changes to an object without the need for
// polling.
//
// Known limitations of this technique:
// 1. the call signature of `Object.observe()` will return the proxy
// object. The original object needs to be overwritten with this return value.
@zeusdeux
zeusdeux / ES5vsES6.js
Last active September 6, 2023 15:03
ES5 inheritance vs ES6 inheritance
/* ES6/ES2015 classes */
class A {
constructor() {
this.a = 10
}
print() {
console.log(this.a, this.b)
}
}
@maddijoyce
maddijoyce / hookLoader.js
Created June 9, 2016 04:39
Istanbul hook loader to be used programatically
import { hook, Instrumenter } from 'babel-istanbul';
import { clone } from 'lodash';
let instrumenter = null;
const baselineCoverage = {};
export function getCoverageObject() {
global.coverage = global.coverage || {};
return global.coverage;
}
@znck
znck / Vue component module
Last active November 26, 2018 01:18
Example for `rollup-plugin-vue`
Create a module for vue component.
import {
Directive, TemplateRef, Input, ChangeDetectorRef, ViewContainerRef,
IterableDiffers, OnChanges, SimpleChanges, SimpleChange
} from '@angular/core';
import { NgFor } from "@angular/common";
import { NgForRow } from "@angular/common/src/directives/ng_for";
@Directive({
selector: '[ngFor][ngForIn]'
})
@tbranyen
tbranyen / _setup.sh
Created May 29, 2017 04:03
Web Components <3 JSDOM
npm i jsdom-wc@11.0.0-alpha-1
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active May 17, 2024 00:12
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@impaler
impaler / compile.js
Last active July 1, 2022 00:54
Compile webpack with typescript in memory
// based on code from https://stackoverflow.com/questions/38779924/compiling-webpack-in-memory-but-resolving-to-node-modules-on-disk
import * as webpack from 'webpack'
import * as MemoryFileSystem from 'memory-fs'
import * as path from 'path'
import * as fs from 'fs'
import * as promisify from 'util.promisify'
const memFs = new MemoryFileSystem()
const statOrig = memFs.stat.bind(memFs)
@jb55
jb55 / default.nix
Last active July 30, 2023 21:45
deploy dotnet core apps on nixos
{ stdenv, lib, bash, callPackage, writeText, makeWrapper, writeScript, dotnet-sdk,
patchelf, libunwind, coreclr, libuuid, curl, zlib, icu }:
let
config = "Staging";
project = "RazorCx.Api";
target = "linux-x64";
rpath = stdenv.lib.makeLibraryPath [ libunwind coreclr libuuid stdenv.cc.cc curl zlib icu ];