Skip to content

Instantly share code, notes, and snippets.

View msand's full-sized avatar

Mikael Sand msand

View GitHub Profile
const {useCallback, useEffect, useReducer, useRef} = require('react');
let effectCapture = null;
exports.useReducerWithEmitEffect = function(reducer, initialArg, init) {
let updateCounter = useRef(0);
let wrappedReducer = useCallback(function(oldWrappedState, action) {
effectCapture = [];
try {
let newState = reducer(oldWrappedState.state, action.action);
@iconifyit
iconifyit / PathSplitter.js
Last active January 12, 2024 22:20
Split SVG path data into subpaths.
/**
* This script was taken from a discussion on Google Groups.
* I'm not taking credit for it but sharing it because it is very useful for splitting
* discontinuous absolute paths into continuous subpaths. Where this is particularly
* useful is for importing SVG files into applications like Figma, Sketch, InVision, XD, etc.
*/
/**
* Split discontinuous absolute paths into continuous sub-paths.
*
* Example:
@sanketsahu
sanketsahu / ReactiveConf-CFP.md
Last active August 22, 2022 04:54
CFP: Reactive Conf: Introducing the React Native Builder

This is a proposal for ReactiveConf 2017 open call for Lightning talks. If you'd like to make this talk happen, please 🌟 this gist and retweet my tweet. 🙏


We are building something that would bring designer and developer on the same file!

Introducing BuilderX

A design tool which writes React Native code for you

BuilderX Demo

✅ Don't just prototype but code as a designer

@andrey-skl
andrey-skl / AppDelegate.m
Created November 16, 2016 14:36
How to enable logging in production build of React Native app
...
#import "RCTLog.h"
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTSetLogThreshold(RCTLogLevelInfo);
...
@supereggbert
supereggbert / index.html
Last active October 15, 2023 23:19
3D Surface Plot in D3.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body{
font-family: sans;
padding: 10px;
}
svg path{