Skip to content

Instantly share code, notes, and snippets.

View nomanHasan's full-sized avatar

Noman Hasan nomanHasan

View GitHub Profile
@nomanHasan
nomanHasan / GenerateCode.js
Last active May 5, 2019 12:28
Model Code Generation automatically by inspecting a javascript object
if (document && !window.R) {
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.R={})}(this,function(t){"use strict";function n(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function r(t){return function r(e){return 0===arguments.length||n(e)?r:t.apply(this,arguments)}}function e(t){return function e(u,i){switch(arguments.length){case 0:return e;case 1:return n(u)?e:r(function(n){return t(u,n)});default:return n(u)&&n(i)?e:n(u)?r(function(n){return t(n,i)}):n(i)?r(function(n){return t(u,n)}):t(u,i)}}}function u(t,n){t=t||[],n=n||[];var r,e=t.length,u=n.length,i=[];for(r=0;e>r;)i[i.length]=t[r],r+=1;for(r=0;u>r;)i[i.length]=n[r],r+=1;return i}function i(t,n){switch(t){case 0:return function(){return n.apply(this,arguments)};case 1:return function(t){return n.apply(this,arguments)};case 2:return function(t,r){return n.apply(this,arguments)};case 3:return function(t,r,e){return n.apply(this,
@nomanHasan
nomanHasan / Docker.bash
Created April 4, 2018 16:18
Docker Common Commands
# Docker Single Delete
docker rmi #id
# Kill containers
docker rm $(docker ps -a -q)
class Action {
constructor(type = '', model = '') {
this.type = ` ${type.toUpperCase().replace(' ', '_')}_`;
this.model = model;
this.modelString = `[${model}]`;
this.upperModel = this.model.toUpperCase();
this.request = this.modelString +
this.type +this.model.toUpperCase();
this.success = this.modelString +
class Action {
constructor(public type) {
}
public request = this.type;
public success = this.type + '_SUCCESS';
public failure = this.type + '_FAILURE';
let Size20 = [-30, -10, 10, 30, 50, 70, 90, 110, 130, 150];
let Size30 = [-40, -10, 20, 50, 80, 110, 140, 170, 200];
const assert = (target, source, title=`TEST ${target} === ${source}`) => {
if(target === source){
return {title, status: "SUCCESS"}
}else{
return {title, status: "FAILED"}
@nomanHasan
nomanHasan / hello.js
Created December 8, 2017 13:06
Minimalistic Express JS
const express = require('express')
const app = express()
app.get('/', (req, res) => res.json({
hello:"hello"
}))
app.listen(3000, () => console.log('Example app listening on port 3000!'))
@nomanHasan
nomanHasan / autoDateGen.js
Created November 26, 2017 09:50
Auto Event Time Generations
getDemoDates = () => {
days = []
for(i = 0; i< 1000; i++){
d = new Date()
dif = Math.random() * 200 - 100
d.setDate(dif)
days.push(d)
}
return days;
}
@nomanHasan
nomanHasan / App.js
Created November 24, 2017 19:52
App.js
import React, { Component } from 'react';
import logo from './logo.svg';
//Import the modified App.css
import './App.css';
// Import the Routes component, which contains our Route setup
import { Routes } from './Routes'
@nomanHasan
nomanHasan / App.css
Created November 24, 2017 19:51
App.css
.option-buttons{
flex: 1;
}
.updating{
background: rgb(0, 172, 172);
}
.done{
background: rgb(69, 226, 69);
@nomanHasan
nomanHasan / todoReducer.js
Created November 24, 2017 19:50
TodoReducer
// Import the TodoAction Creators and TodoActionTypes
import * as TodoActions from '../actions/todoActions'
// We are dividing the reducers using a technique called Reducer composition.
// By doing this we are seperating the reducer for the Collection and the Individual Item