Skip to content

Instantly share code, notes, and snippets.

View mauriciopazpp's full-sized avatar

Mauricio Paz mauriciopazpp

  • Guarapuava-PR / Brazil
  • 07:42 (UTC -12:00)
View GitHub Profile
@mauriciopazpp
mauriciopazpp / bash_terminal_colors.txt
Last active December 24, 2022 12:26
Bash terminal echo colors
An example is
Code:
echo "\033[1;31m Hello \033[0m"
The '31' and the '1' are the things you change. The '31' is the color code, and the '1' is where you put whatever you want to color. The rest of it is the same for every color coding; the beginning starts coloring, and the stuff afterwards stops coloring ('0' switches it back to default text color). You can use the following color codes:
Code:
30 - black
@mauriciopazpp
mauriciopazpp / update-windows-in-powershel.txt
Created November 15, 2018 01:41
Update windows and apps in Powershell
Install-Module PSWindowsUpdate
Get-WindowsUpdate
Install-WindowsUpdate
@mauriciopazpp
mauriciopazpp / cordova_publis_play_store.md
Created November 5, 2018 16:15
Publish cordova app on Play Store

generate keytools file

keytool -genkey -v -keystore mnjic.keystore -alias mnjic -keyalg RSA -keysize 2048 -validity 10000

Sign app

cordova run android --release -- --keystore=mnjic.keystore --storePassword=abcd --alias=mnjic --password=abcd

this command above will generate same entries as below mentioned in build.json

review build.json

@mauriciopazpp
mauriciopazpp / drawer.js
Created August 7, 2018 00:01
react-native drawer
import React from 'react';
import {createDrawerNavigator, DrawerItems} from 'react-navigation';
import Home from '../screens/Home';
import {Image} from "react-native";
import styles from '../styles/Drawer.style';
import Constants from '../constants/Constant';
import { Icon } from "react-native-elements";
const DrawerNav = createDrawerNavigator({
"Now Playing": {
@mauriciopazpp
mauriciopazpp / ReactNativeTabs.js
Created August 1, 2018 01:07
Tabs for React Native
import React from 'react';
import { Button, Text, View } from 'react-native';
import { Ionicons } from '@expo/vector-icons'; // Version can be specified in package.json
import { StackNavigator, TabNavigator, TabBarBottom } from 'react-navigation'; // Version can be specified in package.json
class HomeScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Home!</Text>
@mauriciopazpp
mauriciopazpp / renderImageReactNativeWithCustomSize.js
Created July 31, 2018 23:47
Insert image using the width size of phone
_renderImage(image) {
let contentHeight = scaleModerate(375, 1)
let height = Dimensions.get('window').height - contentHeight
let width = Dimensions.get('window').width
image = (<Image style={[style.image, {height, width}]}
source={ backgroundImg }/>)
return image
}
@mauriciopazpp
mauriciopazpp / blockInternetExplorer.php
Created July 20, 2018 18:12
Block internet explorer php
<?php
preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
if(count($matches) < 2)
{
preg_match('/Trident\/\d{1,2}.\d{1,2}; rv:([0-9]*)/', $_SERVER['HTTP_USER_AGENT'], $matches);
}
@mauriciopazpp
mauriciopazpp / module-resolver-react-native.js
Created July 20, 2018 02:15
module-resolver react-native
"plugins": [
["module-resolver", {
"root": ["./app"],
"alias": {
"@api": "./app/src/api",
"@components": "./app/src/components",
"@screen": "./app/src/screens",
"@store": "./app/src/store",
"!config": "./app/config"
}
@mauriciopazpp
mauriciopazpp / tabs.js
Created July 20, 2018 02:14
React tabs
const HomeTab = createMaterialTopTabNavigator({
Tab1: HomeScreen,
Tab2: HomeScreen02,
Tab3: HomeScreen03,
Tab4: HomeScreen04,
Tab5: HomeScreen05,
Tab6: HomeScreen06,
Tab7: HomeScreen07,
}, {
tabBarOptions: {
@mauriciopazpp
mauriciopazpp / DrawerButton.js
Created July 11, 2018 02:22
DrawerButton react native
const DrawerButton = (props) => {
return (
<View>
<TouchableOpacity onPress={() => {props.navigation.navigate('DrawerOpen')}}>
<Image
source={require('../img/iconImage.png')}
style={styles.icon}
/>
</TouchableOpacity>
</View>