Skip to content

Instantly share code, notes, and snippets.

View raminious's full-sized avatar

Ramin Mo raminious

View GitHub Profile
@raminious
raminious / anti-if.js
Created December 30, 2015 12:16
Try to avoid if statement
var response = 4;
var api = {
dispatch: function(status){
var states = {
1: api.__err,
2: api.__err,
@raminious
raminious / download.js
Created November 2, 2016 19:53
this snippet code should throw an error
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
@raminious
raminious / MainActivity.java
Created April 12, 2022 12:53
MainActivity.java
package com.rnexpo;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
@raminious
raminious / AppDelegate.m
Created April 12, 2022 12:56
react native AppDelegate.m
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTAppSetupUtils.h>
#if RCT_NEW_ARCH_ENABLED
#import <React/CoreModulesPlugins.h>