Skip to content

Instantly share code, notes, and snippets.

View darksh3ll's full-sized avatar

DARKSH3LL darksh3ll

  • France
View GitHub Profile
const formatHashTags = values => {
const transformStringAndArray = values.split(' ');
const deleteBlank = transformStringAndArray.filter(value => {
return value !== '';
});
return deleteBlank.map(value => {
if (value.charAt(0) !== '#') {
const transformValueAndArray = value.split('');
transformValueAndArray.unshift('#');
return transformValueAndArray.join('');
import React, { Component } from 'react';
import {
ScrollView,
StyleSheet, Text, View
} from 'react-native';
import { Button, Slider } from 'react-native-elements';
import SelectionCell from './components/SelectionCell'
import EditField from './components/EditFields';
@darksh3ll
darksh3ll / App.js
Created April 28, 2019 18:48
modale react native
import React, { Component } from 'react';
import {Modal, Text, TouchableHighlight, View, Alert,StyleSheet,TouchableOpacity} from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor:'red'
},
@darksh3ll
darksh3ll / App.js
Last active May 2, 2019 05:14
exemple de refactoring
import React from 'react';
import { StyleSheet, ScrollView, KeyboardAvoidingView, Button, Text, View, Switch } from 'react-native';
import TextEntry from './Components/TextEntry'
import useful from "./useful";
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F1F1F5',
justifyContent: 'center'
import React, { Component } from 'react';
import {
ScrollView,
StyleSheet, Text, View
} from 'react-native';
import { Button, Slider } from 'react-native-elements';
import SelectionCell from './components/SelectionCell'
import EditField from './components/EditFields';
import React from 'react';
import {
StyleSheet, View, Text,
} from 'react-native';
import {
Avatar, Image, Icon, Button,
} from 'react-native-elements';
import I18n from '../I18n/I18n';
const translations = {

Un code JS impeccable grâce à ESLint

ESLint est, comme son nom l’indique, un linter, c’est-à-dire un outil qui analyse statiquement du code et vérifie que celui-ci respecte un certain nombre de règles,

Voici un tutorial pour configurer votre environnement 😉

https://github.com/wesbos/eslint-config-wesbos

@darksh3ll
darksh3ll / imgJson.js
Last active January 28, 2019 10:37
import image json
import React from 'react';
import { Card, CardImg, CardText, CardBody,
CardSubtitle, Button } from 'reactstrap';
const Cards = ({article,addPanier}) => {
return (
<Card className="col-sm-6 col-md-4">
<CardImg top width="100%" src={require(`../../assets/${article.img}`)}
alt="Card image cap"/>
<CardBody>
@darksh3ll
darksh3ll / MapArray.js
Created January 22, 2019 08:41
Map array react
<div>
{this.state.array.map(nom => <h1 key={nom}>{nom}</h1>)}
</div>
const str = "bob";
const newStr = str.split("").reverse().join("") //massi
const result = str === newStr? "PALINDROME":"NO PALINDROME"
console.log(result);