Skip to content

Instantly share code, notes, and snippets.

View christiannwamba's full-sized avatar

Christian Nwamba christiannwamba

  • AWS
  • Lagos, Nigeria
View GitHub Profile
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", {
@christiannwamba
christiannwamba / delete-heroku-apps.sh
Created October 25, 2017 03:15 — forked from naaman/delete-heroku-apps.sh
Delete all heroku apps from bash terminal -- no script file required
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done
@christiannwamba
christiannwamba / destructuring.js
Created November 14, 2017 07:51 — 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
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
{
"name": "pushertableinrealtime",
"version": "1.0.0",
"description": "\"\"",
"main": "app.js",
"scripts": {
"test": "\"echo \\\"Error: no test specified\\\" && exit\" "
},
"repository": {
"type": "git",
@christiannwamba
christiannwamba / app.js
Last active January 17, 2018 17:31 — forked from kenny-io/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({

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:

@christiannwamba
christiannwamba / determine-changed-props.js
Created February 12, 2019 05:33 — forked from sorenlouv/determine-changed-props.js
Determine which props causes React components to re-render
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 => {
/**
* Contructor Function to Class
*/
// BEFORE
function Team(name) {
this.name = name;
this.count = 14
}
const fetch = require('node-fetch');
const bcrypt = require('bcrypt');
module.exports = async function(context, req) {
const HASURA_OPERATION = `
mutation insertUser($username:String, $password:String) {
insert_user(objects: {username: $username, password: $password}) {
affected_rows
}
}
const fetch = require("node-fetch")
const HASURA_OPERATION = `
mutation insertUser($username:String, $password:String) {
insert_user(objects: {username: $username, password: $password}) {
affected_rows
}
}
`;