Skip to content

Instantly share code, notes, and snippets.

View praisegeek's full-sized avatar

Praise-God Emerenini praisegeek

  • Lagos, Nigeria.
View GitHub Profile
import React, {Component} from 'react';
import {View, TouchableOpacity, Text} from 'react-native';
import t from 'tcomb-form-native';
const Form = t.form.Form;
const Country = t.enums({
"AD":"Andorra","AE":"United Arab Emirates","AF":"Afghanistan","AG":"Antigua and Barbuda","AI":"Anguilla","AL":"Albania","AM":"Armenia","AO":"Angola","AQ":"Antarctica","AR":"Argentina","AS":"American Samoa","AT":"Austria","AU":"Australia","AW":"Aruba","AX":"Åland","AZ":"Azerbaijan","BA":"Bosnia and Herzegovina","BB":"Barbados","BD":"Bangladesh","BE":"Belgium","BF":"Burkina Faso","BG":"Bulgaria","BH":"Bahrain","BI":"Burundi","BJ":"Benin","BL":"Saint Barthélemy","BM":"Bermuda","BN":"Brunei","BO":"Bolivia","BQ":"Bonaire","BR":"Brazil","BS":"Bahamas","BT":"Bhutan","BV":"Bouvet Island","BW":"Botswana","BY":"Belarus","BZ":"Belize","CA":"Canada","CC":"Cocos [Keeling] Islands","CD":"Democratic Republic of the Congo","CF":"Central African Republic","CG":"Republic of the Congo","CH":"Switzerland","CI":"Ivory Coast","CK":"Cook Islands
@praisegeek
praisegeek / brew-instructions.sh
Created January 16, 2017 11:23 — forked from petemcw/brew-instructions.sh
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.dev domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@praisegeek
praisegeek / stripe-currencies.js
Created May 22, 2017 03:21 — forked from chrisdavies/stripe-currencies.js
A handy list of currency codes and descriptions for use with Stripe.
'use strict';
// The STRIPE-supported currencies, sorted by code
export const currencies = [
{
'code':'AED',
'description':'United Arab Emirates Dirham'
},
{
'code':'AFN',
@praisegeek
praisegeek / nginx.conf
Last active September 7, 2017 12:54
VestaCP: Phoenix Nginx SSL Conf
# Getting Started.
# 1. Enter visual mode V, then use s/myapp/domain/g to replace all myapp to domain.
# 2. Change upstream port to PORT ENV variable defined in /etc/init.d/myapp
# hide server information
http {
server_tokens off;
}
server {
@praisegeek
praisegeek / code
Last active September 19, 2017 11:19
Visual Studio Code: Add code . to shell path
vim ~/.bash_profile
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
source ~/.bash_profile
Tools & Stuffs
@praisegeek
praisegeek / Readme.md
Created November 14, 2017 17:23
AndroidFileTransfer - Can't find some files
  • go to "Settings"
  • select "Apps"
  • show all Apps (menu "Show System")
  • select the system app "Media Storage"
  • select "Storage"
  • Clear Cache and Clear Storage
  • reboot phone and wait a while for Media Storage to index all your files again
@praisegeek
praisegeek / hideOnScroll.js
Created December 8, 2017 04:54 — forked from mmazzarolo/hideOnScroll.js
react-native-action-button hide on scroll
// 1. Define a state variable for showing/hiding the action-button
state = {
isActionButtonVisible: true
}
// 2. Define a variable that will keep track of the current scroll position
_listViewOffset = 0
// 3. Add an onScroll listener to your listview/scrollview
<ListView
@praisegeek
praisegeek / app-icons.js
Created February 6, 2018 18:36
Load vector icons as sourceMap in React Native
// Define all your icons once,
// load them once,
// and use everywhere
import Ionicons from 'react-native-vector-icons/Ionicons';
import FontAwesome from 'react-native-vector-icons/FontAwesome';
// define your suffixes by yourself..
// here we use active, big, small, very-big..
const replaceSuffixPattern = /--(active|big|small|very-big)/g;
@praisegeek
praisegeek / git.md
Created February 22, 2018 10:02 — forked from brigand/git.md
My Git Aliases

I use git a lot for work and other projects, so I invested the time in creating some high quality aliases that really work for me. These just go in your bash profile (~/.bash_profile or ~/.bashrc or ~/.profile depending on your OS).

I see a lot of people go overboard with aliases, and then end up not using them. They're meant to cover 95% of the commands I use, not 100%.

alias gcam='git commit -am'
alias gs='git status'
alias gplr='git pull --rebase'
alias gpsh='git push'
alias gpo='git push -u origin `git symbolic-ref --short HEAD`'