Skip to content

Instantly share code, notes, and snippets.

View mariabitsch's full-sized avatar

Maria Bitsch mariabitsch

  • Copenhagen, Denmark
View GitHub Profile
@iammerrick
iammerrick / PinchZoomPan.js
Last active April 22, 2024 02:54
React Pinch + Zoom + Pan
import React from 'react';
const MIN_SCALE = 1;
const MAX_SCALE = 4;
const SETTLE_RANGE = 0.001;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.04;
const RESET_ANIMATION_SPEED = 0.08;
const INITIAL_X = 0;
@bellbind
bellbind / .profile
Last active December 18, 2019 10:17
[nodejs][nvm] bash function of node with full `Intl` locales support by automatic installing the prebuilt "icu4c-data" package
[ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh # This loads NVM
function node {
rawnode=$(which node)
icu4cdata=$(dirname $(dirname $rawnode))/lib/node_modules/icu4c-data
[[ -d $icu4cdata ]] || npm install -g icu4c-data@$($rawnode -e '
console.log((v => v.icu_ver_major + v.icu_endianness)(
process.config.variables));')
NODE_ICU_DATA=$icu4cdata $rawnode "$@"
}
@gaearon
gaearon / index.js
Last active January 5, 2022 18:45
Breaking out of Redux paradigm to isolate apps
import React, { Component } from 'react'
import Subapp from './subapp/Root'
class BigApp extends Component {
render() {
return (
<div>
<Subapp />
<Subapp />
<Subapp />
@plugn
plugn / Encode SVG SCSS.markdown
Created December 7, 2015 16:16
Encode SVG SCSS
var pureRender = (Component) => {
Object.assign(Component.prototype, {
shouldComponentUpdate (nextProps, nextState) {
return !shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState);
}
});
};
module.exports = pureRender;
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.
@Carreau
Carreau / kernel.js
Created December 13, 2012 20:09
A node.js kernel for IPython notebook. You can see the explanation of the ipynb rendered in http://nbviewer.ipython.org
zmq = require("zmq")
fs = require("fs")
var config = JSON.parse(fs.readFileSync(process.argv[2]))
var connexion = "tcp://"+config.ip+":"
var shell_conn = connexion+config.shell_port
var pub_conn = connexion+config.iopub_port
var hb_conn = connexion+config.hb_port