Skip to content

Instantly share code, notes, and snippets.

JavaScriptNinja born2net

  • Westlake, CA
Block or report user

Report or block born2net

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
@born2net
born2net / ngrx8_with_immer.ts
Created Jul 10, 2019
ngrx 8+ with immer and support for on() within reducer
View ngrx8_with_immer.ts
import {createReducer} from '@ngrx/store';
import {on} from "@ngrx/store";
import produce, {Draft} from "immer";
export const initialUserState: IUserState = {
knownUsers: [user1, user2],
selectedUser: null,
scenes: null
};
@born2net
born2net / gist:0fe438c5851b4c01326d5bd99e043a58
Created Jul 11, 2016 — forked from elvisciotti/gist:37b99aeff8ff50ebe80a
git: recreate repository based on current files
View gist:0fe438c5851b4c01326d5bd99e043a58
cp .git/config /tmp/gitBackup
rm -rf .git
git init
cp /tmp/gitBackup .git/config
git remote add origin <url from 1st command>
git add .
git status
git commit -m "rewrite history"
git push -f
View VisibilityObserver.js
export class VisibilityObserver {
constructor(element, callback) {
this.callback = callback;
if(window.IntersectionObserver) {
this.observer = new IntersectionObserver(
::this.processChanges, { threshold: [0.5] });
this.observer.observe(element);
View PatchYun.ino
#include <Process.h>
void setup() {
Bridge.begin();
Serial.begin(9600);
while (!Serial)
;
Serial.print("Patching...");
View StandardFirmataForATH0.ino
/*
* Firmata is a generic protocol for communicating with microcontrollers
* from software on a host computer. It is intended to work with
* any host computer software package.
*
* To download a host software package, please clink on the following link
* to open the download page in your default browser.
*
* http://firmata.org/wiki/Download
*/
View StandardFirmataForATH0.ino
/*
* Firmata is a generic protocol for communicating with microcontrollers
* from software on a host computer. It is intended to work with
* any host computer software package.
*
* To download a host software package, please clink on the following link
* to open the download page in your default browser.
*
* http://firmata.org/wiki/Download
*/
You can’t perform that action at this time.