Skip to content

Instantly share code, notes, and snippets.

View born2net's full-sized avatar
🕑
be present

AngularNinja.com born2net

🕑
be present
View GitHub Profile
@born2net
born2net / ngrx8_with_immer.ts
Created July 10, 2019 14:55
ngrx 8+ with immer and support for on() within reducer
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
};
0xcac9188cecf38a79be0105c20ad764ff1dba6b79
0xbf6b84ff5df111c53cebeb68fe4937dfdc0080c3
0x6943A188841D3E27045ee8664Cc529c71059301a
@born2net
born2net / gist:0fe438c5851b4c01326d5bd99e043a58
Created July 11, 2016 16:23
git: recreate repository based on current files
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
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);
@born2net
born2net / PatchYun.ino
Last active August 29, 2015 14:09 — forked from sgk/PatchYun.ino
#include <Process.h>
void setup() {
Bridge.begin();
Serial.begin(9600);
while (!Serial)
;
Serial.print("Patching...");
/*
* 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
*/
/*
* 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
*/