Skip to content

Instantly share code, notes, and snippets.

@muneneevans
muneneevans / delete-node-modules.sh
Last active February 22, 2021 09:55
recursive push#
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
@muneneevans
muneneevans / cors-nginx.conf
Created May 15, 2020 09:23 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@muneneevans
muneneevans / animate.js
Created April 28, 2020 07:05 — forked from shafayeatsumit/animate.js
Example: React Native Maps smooth animation to coordinate and region.
import React, { Component } from 'react';
import {TouchableOpacity, Image,StyleSheet,Dimensions, View, Text, Animated, Easing, PanResponder, Platform } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { MapView } from 'expo';
import DateTimePicker from 'react-native-modal-datetime-picker';
const { width, height } = Dimensions.get('window');
const ASPECT_RATIO = width / height;
const LATITUDE_DELTA = 0.006339428281933124;
const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO;
export const changeBaseTheme = BaseTheme => {
//dispatch an action to change light or dark theme
return dispatch => {
dispatch({
type: "CHANGE_BASE_THEME",
baseTheme: BaseTheme
});
};
};
import * as React from "react";
import { connect } from "react-redux";
import styled, { ThemeProvider } from "styled-components";
const Container = styled.View`
flex: 1;
flex-direction: column;
justify-content: space-between;
background-color: ${props => props.theme.PRIMARY_BACKGROUND_COLOR};
import React, { Component } from "react";
import Login from "./Login";
import { Provider } from "react-redux";
import { createStore, applyMiddleware, combineReducers } from "redux";
import thunk from "redux-thunk"
import themeReducer from "./store/themeReducer";
const store = createStore(combineReducers({themeReducer}), applyMiddleware(thunk));
export default class App extends Component {
@muneneevans
muneneevans / theme.js
Last active November 16, 2018 18:36
Theme reducer
export const base = {
FONT_SIZE_TINY: 8,
FONT_SIZE_SMALL: 12,
FONT_SIZE_MEDIUM: 14,
FONT_SIZE_LARGE: 18,
FONT_SIZE_EXTRA_LARGE: 24,
FONT_SIZE_MASSIVE: 34,
FONT_WEIGHT_LIGHT: "200",
FONT_WEIGHT_MEDIUM: "500",
@muneneevans
muneneevans / App.js
Last active November 16, 2018 14:49
themeable react native
import React, { Component } from "react";
import Login from "./Login";
export default class App extends Component {
render() {
return <Login />;
}
}
import * as React from "react";
import {
Text,
View,
StyleSheet,
TouchableOpacity,
Image,
TextInput
} from "react-native";
@muneneevans
muneneevans / theme.js
Last active November 14, 2018 12:39
A collection of theme objects
export const base = {
FONT_SIZE_MEDIUM: 14,
FONT_SIZE_LARGE: 18,
PRIMARY_FONT_FAMILY: "AvertaDemo-Regular",
PRIMARY_FONT_FAMILY_BOLD: "AvertaDemo-ExtraBoldItalic",
SECONDARY_FONT_FAMILY: "Product-Sans-Regular",
SECONDARY_FONT_FAMILY_ITALIC: "Product-Sans-Italic",
};