Skip to content

Instantly share code, notes, and snippets.

View DeVoresyah's full-sized avatar
:octocat:
Available for Remote

DeVoresyah ArEst DeVoresyah

:octocat:
Available for Remote
View GitHub Profile
@DeVoresyah
DeVoresyah / currencies.ts
Created January 20, 2024 14:59
Currency with Symbol
export const CURRENCIES = [
{ label: "USD", symbol: "$" }, // US Dollar
{ label: "EUR", symbol: "€" }, // Euro
{ label: "JPY", symbol: "¥" }, // Japanese Yen
{ label: "GBP", symbol: "£" }, // British Pound
{ label: "AUD", symbol: "A$" }, // Australian Dollar
{ label: "CAD", symbol: "C$" }, // Canadian Dollar
{ label: "CHF", symbol: "CHF" }, // Swiss Franc
{ label: "CNY", symbol: "¥" }, // Chinese Yuan
{ label: "SEK", symbol: "kr" }, // Swedish Krona
@DeVoresyah
DeVoresyah / .clear_branch.sh
Created September 21, 2022 07:19
Bash file to clear unused branch
#!/bin/bash
function cb() {
git fetch -p ; git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D
}
@DeVoresyah
DeVoresyah / index.js
Created October 14, 2021 10:55
usePrevious React Hook
import React, { useState } from "react";
import usePrevious from "./usePrevious";
const App = () => {
const [count, setCount] = useState(0);
const prevCount = usePrevious(count);
return (
<>
<p>Count: {count} - Previous Count: {prevCount || 0}</p>
@DeVoresyah
DeVoresyah / helper.js
Created April 14, 2021 03:06
Logic Response Handler
export const checkStatusResponse = response => {
if (response.code === 9999) {
// run a function if response ok
} else {
// run a function if response failure
}
}
@DeVoresyah
DeVoresyah / BlurModal.js
Created February 19, 2021 12:31
React Native Blur Modal
import React, { useState, memo, useImperativeHandle, forwardRef, useCallback } from 'react'
import PropTypes from 'prop-types'
import { Modal, View, Text } from 'react-native'
import { BlurView } from '@react-native-community/blur'
// Components
import Button, { ButtonTypes } from '../Button/FullButton'
// Styles
import styles from '../Styles/Modal/BlurModalStyle'
@DeVoresyah
DeVoresyah / ImageViewer.js
Created February 17, 2021 09:42
React Native Multi Image + Viewer
import React, { useState, memo, useImperativeHandle, forwardRef } from 'react'
import PropTypes from 'prop-types'
import { Modal, View, Text } from 'react-native'
import ViewPager from '@react-native-community/viewpager'
import { BlurView } from '@react-native-community/blur'
import Icon from 'react-native-vector-icons/FontAwesome5'
// Components
import Image from '../App/Image'
import Button from '../Button/Button'
@DeVoresyah
DeVoresyah / index.js
Created December 11, 2020 03:54
Find Suitable Sport
const sports = [{
id: "Basketball",
age: {
min: 18,
max: 30
},
males: {
min: 40,
max: 60
},
@DeVoresyah
DeVoresyah / makeACofee.js
Created November 26, 2020 14:42
Make A Coffee
const makeACoffee = (buyer, specs) => {
const coffees = []
buyer.map(person => {
const findSpec = specs.find(opt => person === opt.id)
coffees.push({
id: person,
coffee: `Cofee with ${findSpec.options}`
})
import createPersistedState from 'vuex-persistedstate'
import * as Cookies from "js-cookie";
let cookieStorage = {
getItem: function(key) {
return Cookies.getJSON(key);
},
setItem: function(key, value) {
return Cookies.set(key, value, {expires: 3, secure: false});
},
@DeVoresyah
DeVoresyah / TextUtil.js
Created July 6, 2020 18:57
text utility
export default class TextUtil {
strReplace = (source, replace, replaceWith) => {
var value = source
var i = 0
for (i; i < value.length; i++) {
value = value.replace(replace, replaceWith)
}
console.log(value)
return value;
}