Skip to content

Instantly share code, notes, and snippets.

View praisegeek's full-sized avatar

Praise-God Emerenini praisegeek

  • Lagos, Nigeria.
View GitHub Profile
@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
@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 / 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`'
@praisegeek
praisegeek / provisioning.sh
Created March 18, 2018 23:17 — forked from rydurham/provisioning.sh
Ubuntu Provisioning
# Basics
sudo apt update
sudo apt install curl vim git libpng-dev
# Ngninx
sudo apt install nginx
# Postgres
sudo apt install postgresql postgresql-contrib
sudo -i -u postgres
@praisegeek
praisegeek / baseModel.php
Created August 6, 2018 15:57 — forked from nurrony/baseModel.php
#laravel #php A query scope for sorting and searching/filtering
<?php
/**
* Use this query scope from any model/controller
* It works on single table only, so for joined columns, make a mysql view and operate on that
* Example request fromat
*/
/*
[
'query' => [
@praisegeek
praisegeek / iterm2-solarized.md
Created October 23, 2018 01:26 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@praisegeek
praisegeek / hlsdump.js
Created January 9, 2020 13:03 — forked from astro/hlsdump.js
Reliably record an HTTP Live Stream with node.js
var fs = require('fs');
var request = require('request');
var joinUrl = require('url').resolve;
if (process.argv.length != 3) {
console.log("Please pass playlist URL");
process.exit(1);
}
var plsUrl = process.argv[2];
var INTERVAL = 5 * 1000;
import 'package:flutter/material.dart';
class AnimatedCount extends ImplicitlyAnimatedWidget {
AnimatedCount({
Key key,
@required this.count,
@required Duration duration,
Curve curve = Curves.linear,
}) : super(duration: duration, curve: curve, key: key);