Skip to content

Instantly share code, notes, and snippets.

View dmrqx's full-sized avatar
🇧🇷
Todo meu canto / Sai do meu coração

J. Demarque dmrqx

🇧🇷
Todo meu canto / Sai do meu coração
View GitHub Profile
import { Platform, NativeModules } from 'react-native'
import I18n from 'i18n-js'
import en from './en-US' // importa o objeto de traduções para o idioma inglês
import pt from './pt-BR' // importa o objeto de traduções para o idioma português
// Função que irá nos auxiliar a normalizar as traduções que serão recebidas pela função getLanguageByDevice
// Isso é necessário pois no android e no iOS o retorno do mesmo idioma pode ser diferente
// Exemplo: no iOS podemos receber pt_US e no android pt_BR para o idioma português Brasil.
const normalizeTranslate = {
'en_US': 'en_US',
@QinMing
QinMing / .zshrc
Last active March 10, 2024 22:17
.zshrc (lazy loading shell functions)
# Copyright (c) 2016-2018 Ming Qin (覃明) <https://github.com/QinMing>
# Open source under MIT LICENSE.
lazy_load() {
# Act as a stub to another shell function/command. When first run, it will load the actual function/command then execute it.
# E.g. This made my zsh load 0.8 seconds faster by loading `nvm` when "nvm", "npm" or "node" is used for the first time
# $1: space separated list of alias to release after the first load
# $2: file to source
# $3: name of the command to run after it's loaded
# $4+: argv to be passed to $3
@mtinsley
mtinsley / Lazy Image Size
Created June 7, 2015 19:02
Generate image sizes on the fly for WordPress
/**
* Create an image with the desired size on-the-fly.
*
* @param $image_id
* @param $width
* @param $height
* @param $crop
*
* @return array
*/