Skip to content

Instantly share code, notes, and snippets.

Christian Nwamba christiannwamba

Block or report user

Report or block christiannwamba

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@christiannwamba
christiannwamba / determine-changed-props.js
Created Feb 12, 2019 — forked from sqren/determine-changed-props.js
Determine which props causes React components to re-render
View determine-changed-props.js
import React, { Component } from 'react';
export default function withPropsChecker(WrappedComponent) {
return class PropsChecker extends Component {
componentWillReceiveProps(nextProps) {
Object.keys(nextProps)
.filter(key => {
return nextProps[key] !== this.props[key];
})
.map(key => {
View keybase.md

Keybase proof

I hereby claim:

  • I am christiannwamba on github.
  • I am codebeast (https://keybase.io/codebeast) on keybase.
  • I have a public key ASBKNY2Uu6AUXzp4Dlwhir4rpkEZ8QR-9F4QNh8lD4k5tgo

To claim this, I am signing this object:

View package.json
{
"name": "pushertableinrealtime",
"version": "1.0.0",
"description": "\"\"",
"main": "app.js",
"scripts": {
"test": "\"echo \\\"Error: no test specified\\\" && exit\" "
},
"repository": {
"type": "git",
View app.js
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var Pusher = require('pusher');
var pusher = new Pusher({
@christiannwamba
christiannwamba / destructuring.js
Created Nov 14, 2017 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
View destructuring.js
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@christiannwamba
christiannwamba / delete-heroku-apps.sh
Created Oct 25, 2017 — forked from naaman/delete-heroku-apps.sh
Delete all heroku apps from bash terminal -- no script file required
View delete-heroku-apps.sh
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done
View ds-realtime-chart--client.js
var client = deepstream('APP--URL')
// Login
client.login()
client.rpc.make( 'price-chart', { }, ( err, results ) => {
var dataPoints = results;
console.log(dataPoints)
var chart = new CanvasJS.Chart("chartContainer", {
View ds-realtime-chart--client.html
<html>
<head></head>
<body>
<div id = "chartContainer" style = "height: 300px; width: 100%;" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/canvasjs/1.7.0/canvasjs.min.js"></script>
<script src="https://code.deepstreamhub.com/js/2.x/deepstream.min.js"></script>
<script>
// Script here
</script>
</body>
View ds-realtime-chart--client.html
<html>
<head></head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/canvasjs/1.7.0/canvasjs.min.js"></script>
<script src="https://code.deepstreamhub.com/js/2.x/deepstream.min.js"></script>
<script>
var client = deepstream('wss://154.deepstreamhub.com?apiKey=430ca16b-b7f1-40e4-bf08-dca693e913df')
// Login
client.login()
View ds-realtime-chart--data.json
{
"bpi": {
"2017-01-01": 997.6888,
"2017-01-02": 1018.05,
"2017-01-03": 1030.8175,
"2017-01-04": 1129.87,
"2017-01-05": 1005.815,
"2017-01-06": 895.67,
"2017-01-07": 905.17,
}
You can’t perform that action at this time.