Skip to content

Instantly share code, notes, and snippets.

View darksh3ll's full-sized avatar

DARKSH3LL darksh3ll

  • France
View GitHub Profile
@darksh3ll
darksh3ll / aircarto.dart
Last active May 6, 2023 17:59
app flutter
import 'package:flutter/material.dart';
import 'package:mqtt_client/mqtt_client.dart';
import 'package:mqtt_client/mqtt_server_client.dart';
import 'dart:async';
final StreamController<Map<String, String>> mqttMessageController = StreamController<Map<String, String>>.broadcast();
Future<void> connectAndSubscribeToMQTT() async {
const String broker = '';
@darksh3ll
darksh3ll / InputCell.js
Created April 7, 2020 08:05
plusieurs styles en meme temps
style={[styles.input, { borderColor: color, backgroundColor: '#f8f8f8' }]}
mport React, { useEffect,useState } from 'react';
import { useDispatch, useSelector } from 'react-redux'
import axios from 'axios'
const Testing = () => {
const [value,setValue] = useState('')
const dispatch = useDispatch();
const users = useSelector(state => state.userReducers.data);
useEffect(() => {
axios
.get('https://jsonplaceholder.typicode.com/users/')
import React, {Component, PureComponent} from 'react';
import { View, Text, Dimensions, StyleSheet } from 'react-native';
import NetInfo from '@react-native-community/netinfo';
const { width } = Dimensions.get('window');
function MiniOfflineSign() {
return (
<View style={styles.offlineContainer}>
<Text style={styles.offlineText}>No Internet Connection</Text>
@darksh3ll
darksh3ll / loadingWebView.js
Last active January 6, 2020 09:47
exemple de loading avec une WebView react native
import React, { useState } from 'react'
import { ActivityIndicator, View, StyleSheet } from 'react-native'
import { WebView } from 'react-native-webview'
const styles = StyleSheet.create({
WebViewStyle: {
justifyContent: 'center',
alignItems: 'center',
flex: 1,
marginTop: 40
},
@darksh3ll
darksh3ll / mediaQueries.css
Created January 5, 2020 17:32
media-queries-for-standard-devices
/*-----------------APPLE---------------------- */
/* ----------- iPhone 4 and 4S ----------- */
/* Portrait and Landscape */
@media only screen
and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2) {
const defaultNavigationOptions = {
headerStyle: { backgroundColor: '#239abb', borderBottomWidth: 0 },
headerTintColor: '#fff',
headerBackTitle: null,
};
class BadgeNotification extends PureComponent {
render() {
return (
@darksh3ll
darksh3ll / Navigation.js
Created December 27, 2019 13:16
Probléme d'implémentation Drawer navigation
import React from 'react'
import { View } from 'react-native'
import { Badge } from 'react-native-elements'
import { createAppContainer, createSwitchNavigator } from 'react-navigation'
import { createStackNavigator } from 'react-navigation-stack'
import { createDrawerNavigator } from 'react-navigation-drawer'
import { createBottomTabNavigator } from 'react-navigation-tabs'
import Icon from 'react-native-vector-icons/FontAwesome'
// Screens Auth
import Welcome from './screens/Auth/Welcome'
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
import { createStore, combineReducers } from 'redux'
import { Provider } from 'react-redux'
import * as serviceWorker from './serviceWorker'
import languageReducer from './store/languageReducer'
const store = createStore(
'use strict';
const bcrypt = require('bcrypt');
module.exports = (sequelize, DataTypes) => {
const User = sequelize.define('User', {
firstname: DataTypes.STRING,
lastname: DataTypes.STRING,
email:{
type:DataTypes.STRING,
validate:{
isEmail:true