Skip to content

Instantly share code, notes, and snippets.

View christiannwamba's full-sized avatar

Christian Nwamba christiannwamba

  • AWS
  • Lagos, Nigeria
View GitHub Profile
@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 => {
{
"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({
@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];
@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 / ngrxintro.md
Created October 15, 2016 09:53 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

#Comprehensive Introduction to @ngrx/store By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@christiannwamba
christiannwamba / gist:c374e0337f3b20a9aa6d82a50cdcb6a2
Created September 22, 2016 00:53 — forked from axoplasm/gist:bdda3922fa43b2ef25d8
Ditching Compass and Sass for LibSass

I had a large client framework extending my personal boilerplate that was taking upwards of 10seconds to compile with standard Ruby Sass. This framework had minimal dependencies:

I used Bundler to manage Ruby dependencies and ran tasks with Grunt — mainly compiling Sass via grunt-contrib-compass, and previewing with live-reload. Simple stuff.

But 10seconds was an unacceptable performance hit for me. I typically keep my monitor split in half (using Spectacle ), with a browser on one half and MacVim on the other. With Live Reload running I get a nearly realtime preview of my work … except for that one client framework, where I was gettin

@christiannwamba
christiannwamba / jsbin.gupusu.js
Created July 26, 2016 10:26 — forked from anonymous/index.html
Addy's Observer Pattern example JS Bin// source http://jsbin.com/gupusu
console.clear();
/*!
* Pub/Sub implementation
* http://addyosmani.com/
* Licensed under the GPL
*/
var pubsubz = {};
(function (q) {
@christiannwamba
christiannwamba / jsbin.lojexi.js
Last active July 26, 2016 10:26 — forked from anonymous/index.html
Addy's Mediator Pattern example JS Bin// source http://jsbin.com/lojexi
console.clear();
var mediator = (function(){
// Storage for our topics/events
var channels = {};
// Subscribe to an event, supply a callback to be executed
// when that event is broadcast
var subscribe = function(channel, fn){
if (!channels[channel]) channels[channel] = [];
@christiannwamba
christiannwamba / install-mongodb.md
Created July 19, 2016 08:44 — forked from adamgibbons/install-mongodb.md
Install MongoDB on Mac OS X 10.9

Install MongoDB with Homebrew

brew install mongodb
mkdir -p /data/db

Set permissions for the data directory

Ensure that user account running mongod has correct permissions for the directory: