Skip to content

Instantly share code, notes, and snippets.

View robophil's full-sized avatar
🍷
Working from home

Balogun Oghenerobo Philip robophil

🍷
Working from home
View GitHub Profile
@robophil
robophil / contact-manager.js
Created July 24, 2017 00:27
Simple approach to mapping contact data
const contacts = [{id: 1, name: "DF lade", country: "nig", no: 090}, {id: 2, name: "Miss Akesuwa", country: "nig", no: 090}, {id: 3, name: "wendy", country: "nig", no: 090}, ]
const message = `Hello {{name}}, welcome to {{country}}`
function validate(message){
return true
}
const contactKeys = Object.keys(contacts[0])
@robophil
robophil / install-elastic-1.5.2-basic-auth
Created June 7, 2017 14:43 — forked from phamquick/install-elastic-1.5.2-basic-auth
Install ElasticSearch 1.5.2 + Basic Auth on Centos 6.x Server
sudo su
yum update -y
#*************** INSTALL JAVA JDK 8*********************#
yum install java-1.8.0-openjdk -y
#*************** INSTALL ELASTICSEARCH 1.5.2 + RECOMMENDED PLUGINS *********************#
wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.5.2.noarch.rpm
yum install elasticsearch-1.5.2.noarch.rpm -y
rm -f elasticsearch-1.5.2.noarch.rpm
@robophil
robophil / installvagrant
Created June 2, 2017 15:17 — forked from rrgrs/installvagrant
installs brew, virtualbox, and vagrant in osx
if ! type "brew" > /dev/null; then
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)";
fi
brew tap phinze/homebrew-cask && brew install brew-cask;
brew cask install vagrant;
brew cask install virtualbox;
@robophil
robophil / waterline-express-example.js
Last active May 30, 2017 14:28
using waterline with express
/**
* A simple example of how to use Waterline v0.10 with Express
*/
var _ = require('lodash');
var Waterline = require('waterline');
// Instantiate a new instance of the ORM
@robophil
robophil / env-examples.md
Created April 20, 2017 14:46 — forked from ericelliott/env-examples.md
env-examples

Most configuration really isn't about the app -- it's about where the app runs, what keys it needs to communicate with third party API's, the db password and username, etc... They're just deployment details -- and there are lots of tools to help manage environment variables -- not the least handy being a simple .env file with all your settings. Simply source the appropriate env before you launch the app in the given env (you could make it part of a launch script, for instance).

env files look like this:

SOMEVAR="somevalue"
ANOTHERVAR="anothervalue"

To source it:

$ source dev.env # or staging.env, or production.env, depending on where you're deploying to

@robophil
robophil / a.js
Created April 7, 2017 16:18
laju
Account.find({help:'ph'}).then(data=>data.forEach(account=>{Promise.all([ProvideHelp.findOne({account:account.id}),GetHelp.findOne({account:account.id})]).then(data=>{var ph=data[0],gh=data[1];if(!ph&&!gh){ProvideHelp.create({account:account.id,level:account.level}).then(d=>console.log(d))}})}));
package com.payporte.mobile.activity;
import android.os.Bundle;
public class ProductActivity extends AppCompatActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.product);
@robophil
robophil / AndroidManifest.xml
Last active April 7, 2017 12:58
Sample <activity> tag to handle deep linking for payporte.com mobile app. See https://developer.android.com/training/app-indexing/deep-linking.html
<activity
android:name="com.payporte.mobile.ProductActivity"
android:label="@string/category_title" >
<intent-filter android:label="@string/filter_title_product">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.payporte.com/category” -->
<data android:scheme="http"
android:host="www.payporte.com"
<app-header></app-header>
<div id="page-content" class="header-static">
<div id="flexslider" class="fullpage-wrap small">
<ul class="slides">
<li style="background-image:url(assets/img/dollar.jpg)">
<div class="text">
<h3 class="">Welcome to Jaranaira.com</h3>
<h3 class="grey-light">Create an account <br>below</h3>
<div class="row">
<div class="col-md-3 col-xs-0"></div>
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Response } from '@angular/http';
import * as localForage from "localforage"
import { HttpService } from '../../http.service';
@Component({
selector: 'app-register',