Skip to content

Instantly share code, notes, and snippets.

View femicodes's full-sized avatar
🎧
Locked in

Oluwafemi femicodes

🎧
Locked in
  • localhost:5000
View GitHub Profile
@femicodes
femicodes / README.md
Created October 15, 2023 13:06 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@femicodes
femicodes / expo-typescript-eslint-prettier.md
Created October 17, 2022 13:47 — forked from yovany-lg/expo-typescript-eslint-prettier.md
Setting up React Navite: Expo + Typescript + Eslint (Airbnb) + Prettier

Steps to get started with Expo, Typescript, ESLint and Prettier

The first step is to use the Expo CLI to initialize the project. If you don't have the latest version of the Expo CLI tool, (or you don't have it installed) run npm install -g expo-cli.

Now run the following commands in the same order:

  • expo init my-app -t expo-template-blank-typescript
  • npx install-peerdeps --dev eslint-config-airbnb
  • npm i --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin
  • npm i --save-dev prettier eslint-config-prettier eslint-plugin-prettier

Create or edit the file .eslintrc.json with the following content:

@femicodes
femicodes / fix_rbenv.md
Created June 23, 2022 20:46 — forked from esteedqueen/fix_rbenv.md
How to fix rbenv: version `x.x.x` is not installed

So, you just cloned an existing project's repo and you run bundle install but you got the error: rbenv: version x.x.x is not installed....

What the issue means? The project uses a specific ruby version that you do not have on your system.

Here's how to fix it:

  • Install the Ruby build for the specified version using:
rbenv install x.x.x
import axios from 'axios';
import { USER_NAME, PASSWORD, REST_END_POINT } from './ApiConstants';
function baseAxios(options) {
const defaultHeaders = {
'Content-Type': 'application/json',
'Accept-Language': options.language ? options.language : 'en',
'lang': options.lang ? options.lang : 'en',
username: USER_NAME,
password: PASSWORD,
const widthPercentageToDP = widthPercent => {
const screenWidth = Dimensions.get('window').width;
const elemWidth = parseFloat(widthPercent);
return PixelRatio.roundToNearestPixel(screenWidth * elemWidth / 100);
};
const heightPercentageToDP = heightPercent => {
const screenHeight = Dimensions.get('window').height;
const elemHeight = parseFloat(heightPercent);
return PixelRatio.roundToNearestPixel(screenHeight * elemHeight / 100);
};
@femicodes
femicodes / postgres-brew.md
Created September 27, 2020 11:03 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@femicodes
femicodes / redis.js
Created May 19, 2020 23:36 — forked from haidarafif0809/redis.js
Redis Middleware using in nodejs express js.
const redis = require("redis");
const redis_url = process.env.REDIS_URL || null;
const client = redis.createClient(redis_url);
module.exports = {
getCached: (req, res, next) => {
const { redis_key } = req.headers
client.get(redis_key, function(err, reply) {
if (err) {
@femicodes
femicodes / 06.png
Created December 17, 2019 09:14 — forked from mfd/06.png
Gilroy font
06.png
const sampleOptions = [
{ id: 'option-type', value: '3' },
{ id: 'option-type', value: '100336' },
{ id: 'option-type', value: '100354' },
{ id: 'option-type', value: '3' },
{ id: 'option-type', value: '109538' },
{ id: 'option-type', value: '3' },
{ id: 'option-type', value: '8303' },
{ id: 'option-type', value: '504' },
{ id: 'option-type', value: '503' },
@femicodes
femicodes / passport.js
Created October 14, 2019 11:26 — forked from alexanmtz/passport.js
Authentication with Node.js, Express, Sequelize, JWT and webtokens
const {
github
} = require('./secrets')
const passport = require('passport')
const gitHubStrategy = require('passport-github2').Strategy
const LocalStrategy = require('passport-local').Strategy
const passportJWT = require('passport-jwt')
const ExtractJWT = passportJWT.ExtractJwt
const JWTStrategy = passportJWT.Strategy
const jwt = require('jsonwebtoken')