Skip to content

Instantly share code, notes, and snippets.

View Philip-Nunoo's full-sized avatar

Philip Nunoo Philip-Nunoo

View GitHub Profile
// Using axios and fast-xml-parser you can retrieve the data received as xml and converted to json object.
import axios from 'axios';
var fastXmlParser = require('fast-xml-parser');
let jsonObj = {};
axios.get('https://virgool.io/feed/@jEbrahimi')
.then(xml => xml.data)
.then(xmlText => {
if (fastXmlParser.validate(xmlText)) {
@Philip-Nunoo
Philip-Nunoo / App.js
Created December 18, 2018 14:08 — forked from madcoda/App.js
React-router v4 multi layout
import React, { Component } from 'react'
import { BrowserRouter as Router, Route, Link, Match, Redirect, Switch } from 'react-router-dom'
import OverviewPage from './page/OverviewPage'
import AccountPage from './page/AccountPage'
/*
Layouts, inline define here for demo purpose
you may want to define in another file instead
*/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.phil.wrapper;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jpos.iso.ISOException;
@Philip-Nunoo
Philip-Nunoo / tableRenderingExample.js
Created December 26, 2017 07:09 — forked from markerikson/tableRenderingExample.js
React expandable table rows example
class ParentComponent extends Component {
constructor() {
super();
this.state = {
data : [
{id : 1, date : "2014-04-18", total : 121.0, status : "Shipped", name : "A", points: 5, percent : 50},
{id : 2, date : "2014-04-21", total : 121.0, status : "Not Shipped", name : "B", points: 10, percent: 60},
{id : 3, date : "2014-08-09", total : 121.0, status : "Not Shipped", name : "C", points: 15, percent: 70},
{id : 4, date : "2014-04-24", total : 121.0, status : "Shipped", name : "D", points: 20, percent : 80},
@Philip-Nunoo
Philip-Nunoo / gh-pages-deploy.md
Created October 28, 2016 03:14 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@Philip-Nunoo
Philip-Nunoo / Helper.js
Created October 22, 2016 06:56
Formatting date of the format yyyy-MM-dd'T'HH:mm:ss.SSSZ
package com.code4startups.your.package.name;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Config {
public static Date getDateFromStringDate(String dateInString) throws ParseException {
Log.e("dd", dateInString);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
@Philip-Nunoo
Philip-Nunoo / .gitignore
Created October 6, 2016 04:15
gitignore for ios
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
@Philip-Nunoo
Philip-Nunoo / index.html
Created August 17, 2016 12:30
Into an Electron App with Photon (Part I) https://medium.com/p/d0cabbcf6307
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
@Philip-Nunoo
Philip-Nunoo / class.js
Created August 7, 2016 16:00
A basic gist illustrating the use of ES6 classes compared to ES5. https://medium.com/@philipaffulnunoo/migrating-to-es6-classes-67800de0d2a2
class Car {
constructor(number_of_wheels, number_of_doors) {
this.number_of_wheels = number_of_wheels;
this.number_of_doors = number_of_doors;
}
getCarInfo() {
return this.number_of_wheels + ' wheels, ' + this.number_of_doors + ' doors.';
}
}