Skip to content

Instantly share code, notes, and snippets.

@marekyggdrasil
marekyggdrasil / README.md
Created February 4, 2019 09:19
How to fix Ruby TLS support

OSX Sierra version 10.12.6

if you are getting error like

ERROR:  Could not find a valid gem '<some package name>' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect retur

test your TLS v1.2 support

@joshwcomeau
joshwcomeau / FitText.js
Created December 29, 2017 00:24
FitText port
// @flow
// Reimplementation of the jQuery plugin "FitText"
// https://github.com/davatron5000/FitText.js/blob/master/jquery.fittext.js
import React, { PureComponent } from 'react';
type Props = {
compressor: number,
children: React$Node,
};
@zshell31
zshell31 / react-native-pinch-zoom.js
Created September 19, 2016 13:32
React Native: how to implement pinch to zoom gesture
/** Links:
* - http://stackoverflow.com/questions/36368919/scrollable-image-with-pinch-to-zoom
* - http://blog.lum.pe/gesture-detection-in-react-native-fixing-unexpected-panning/
*
*/
import React, {Component, PropTypes} from 'react';
import { Text, View, PanResponder, Image } from 'react-native';
function calcDistance(x1, y1, x2, y2) {
@gaearon
gaearon / connect.js
Last active June 24, 2024 09:43
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (