🚥 solve the Error: Naming collision detected for fbjs on react-native start
rm -rf node_modules/
npm i
npm uninstall fbjs
find . -name 'fbjs' -print | grep "\./node_modules/fbjs" -v | xargs rm -rf
npm i fbjs
| const ReactPerf = require('ReactPerf'); | |
| const TRACE_DOM = false; | |
| function reactPerfTrace(objName: string, fnName: string, func: any): any { | |
| return function(component) { | |
| let label; | |
| if (objName === 'ReactCompositeComponent') { | |
| var instName = this.getName() || 'Unknown'; | |
| label = fnName === 'mountComponent' || fnName === 'updateComponent' ? instName : `${instName}.${fnName}`; |
🚥 solve the Error: Naming collision detected for fbjs on react-native start
rm -rf node_modules/
npm i
npm uninstall fbjs
find . -name 'fbjs' -print | grep "\./node_modules/fbjs" -v | xargs rm -rf
npm i fbjs
Picking the right architecture = Picking the right battles + Managing trade-offs
| // a typescript implement of hindley-milner type inference | |
| // reference http://smallshire.org.uk/sufficientlysmall/2010/04/11/a-hindley-milner-type-inference-implementation-in-python/ | |
| /// <reference path="./lib.es6.d.ts" /> | |
| // ... | |
| interface AstNode { | |
| } | |
| class Id implements AstNode { |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # /*########################################################################## | |
| # | |
| # Copyright (c) 2016 European Synchrotron Radiation Facility | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| const stateIdLens = propLens('id') | |
| const stateTokenLens = propLens('token') | |
| let setCurrentUserId = (state, action) => set(idLens, action.payload.result, state) | |
| let setCurrentUserToken = (state, action) => set(tokenLens, action.payload.token, state) | |
| compose(setCurrentUserId, setCurrentUserToken) | |
| "use strict" | |
| var m = require("monet"); | |
| var MonadT = m.MonadT; | |
| var IO = m.IO; | |
| var Observable = require("rx").Observable; | |
| class IOObs { | |
| constructor(ioObservable){ | |
| this.value = ioObservable; | |
| } |
| ExUnit.start() | |
| defmodule CompileTimeAssertions do | |
| defmacro assert_compile_time_raise(expected_exception, expected_message, fun) do | |
| # At compile-time, the fun is in AST form and thus cannot raise. | |
| # At run-time, we will evaluate this AST, and it may raise. | |
| fun_quoted_at_runtime = Macro.escape(fun) | |
| quote do | |
| assert_raise unquote(expected_exception), unquote(expected_message), fn -> |
A couple of days ago, I wrote a Cycle.js app using Elm to render stuff to the page. This was pretty fun and got some attention, so I might as well write about it some.
A Cycle.js application consists of three parts: your main function declaration, your drivers setup, and your application initialization with Cycle.run (which sets up the "Cycle" part of your application). We'll do the following in our app:
| import React, {DeviceEventEmitter} from 'react-native'; | |
| import {Observable} from 'rx-lite' | |
| /** | |
| * Creates an Observable to listen to any event of DeviceEventEmitter | |
| * @param type {string} Event type | |
| */ | |
| export default createObservableFromDeviceEventEmitter$ = type => { | |
| let subscription; | |
| return Observable.fromEventPattern( |