Skip to content

Instantly share code, notes, and snippets.

View sibelius's full-sized avatar
🦈
give me a feedback https://entria.feedback.house/sibelius

Sibelius Seraphini sibelius

🦈
give me a feedback https://entria.feedback.house/sibelius
View GitHub Profile
defmodule RethinkDB.Response do
@moduledoc false
def parse(raw_data, token, pid) do
d = Poison.decode!(raw_data)
r = RethinkDB.Pseudotypes.convert_reql_pseudotypes(d["r"])
profile = d["p"]
type = d["t"]
resp = case type do
@lucasbento
lucasbento / SomeInfinityLoadingSearch.js
Last active October 5, 2016 00:12
Easy infinity loading with React
class SomeInfinityLoadingSearch extends Component {
state = {
isLoading: false,
}
handleScroll = () => {
if (((window.innerHeight + window.scrollY) >= document.body.offsetHeight) && !this.state.isLoading) {
this.setState({
isLoading: true,
});
@pstockley
pstockley / SearchField.js
Created October 6, 2016 01:48
Cross Platform Search Field on Exponent
/* @flow */
import React from 'react';
import {StyleSheet, Text, View, TextInput, Platform} from 'react-native';
import _ from 'lodash';
import {MaterialIcons, Ionicons} from '@exponent/vector-icons';
import TouchableNativeFeedbackSafe from '@exponent/react-native-touchable-native-feedback-safe/TouchableNativeFeedbackSafe';
type KeyBoardType = "default" | "email-address" | "numeric" | "phone-pad" |
@majak
majak / #8607.patch
Created September 27, 2016 16:33
ios view clipping issue #8607
diff --git a/node_modules/react-native/React/Views/RCTScrollView.m b/node_modules/react-native/React/Views/RCTScrollView.m
--- a/node_modules/react-native/React/Views/RCTScrollView.m
+++ b/node_modules/react-native/React/Views/RCTScrollView.m
@@ -136,7 +136,7 @@
* default UIKit behaviors such as textFields automatically scrolling
* scroll views that contain them and support sticky headers.
*/
-@interface RCTCustomScrollView : UIScrollView<UIGestureRecognizerDelegate>
+@interface RCTCustomScrollView : UIScrollView<UIGestureRecognizerDelegate, RCTClippingView>
componentWillMount() {
global.addEventListener("keyPress", this._handleEscKey, false);
};
componentWillUnmount() {
global.removeEventListener("keyPress", this._handleEscKey, false);
};
_handleEscKey = (event) => {
if(event.keyCode == 27){
import React, { Component } from 'react';
import Relay from 'react-relay';
import FacebookButton from '../utils/fb';
class SearchPage extends Component {
state = {
value: this.props.value
}
@johanobergman
johanobergman / Info.md
Last active November 8, 2016 09:53
Remember the rangeBehaviors of a Relay connection

To remember a connection, run RangeBehaviors.remember in relay.prepareVariables with a name, the connection arguments and an optional rangeBehavior operation:

prepareVariables(variables) {
    var { startDate, endDate } = variables;

    RangeBehaviors.remember('items', { startDate, endDate }, 'prepend'); // append if not specified

    return variables;
}
@sibelius
sibelius / Codemod RN24 to RN25.md
Last active November 9, 2016 13:09
Codemod React Native 24 imports to RN25 imports

README

Why this transform is necessary?

Until React Native 24, you import React from 'react-native' package, but this will change on RN 25, you will need to import React from 'react'. You probably have many files that does this, so I've created a codemod to save you a bunch of time

How to use this

  • Install jscodeshif
//webpack.config.js
const config = {
externals: {
'window': 'Window'
},
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.json'],
alias: {
'jwplayer': path.join(__dirname, '../src/components/VideoPage/lib/jwplayer.js')
@satya164
satya164 / MainActivity.java
Last active December 2, 2016 20:03
react-native-fbsdk in React Native 0.29.+
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "MyApp";
}