Skip to content

Instantly share code, notes, and snippets.

View aakashsigdel's full-sized avatar

Aakash Sigdel aakashsigdel

View GitHub Profile

Keybase proof

I hereby claim:

  • I am aakashsigdel on github.
  • I am aakashsigdel (https://keybase.io/aakashsigdel) on keybase.
  • I have a public key ASBydf6x_X26JyH0ZME5GGyU0K8Y7AQOcOtANJ0NTxQlLQo

To claim this, I am signing this object:

@aakashsigdel
aakashsigdel / Flatten an array
Created July 3, 2016 10:10
Flatten a nested array
// eg: [[1,2,[3]],4] -> [1,2,3,4]
const flattenAnArray = (orgArr) => {
return orgArr.reduce((prevValue, arrayOrNot) => {
return prevValue.concat(Array.isArray(arrayOrNot) ? flattenAnArray(arrayOrNot) : arrayOrNot)
}, [])
}
@aakashsigdel
aakashsigdel / Example react-native code
Created June 14, 2016 03:16
Example react-native code
import React, {
Alert,
Component,
Text
} from 'react-native'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import ProfileIndex from '../components/Profile/ProfileIndex'
import Mixpanel, * as MixpanelConfig from '../constants/MixPanelConfigs'
import * as VideoActionCreators from '../redux_x/actions/videoActionCreators'