A Pen by Michael Lewis on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "extends": "eslint:recommended", | |
| "parserOptions": { | |
| "ecmaVersion": 6, | |
| "ecmaFeatures": { | |
| "jsx": true | |
| }, | |
| "sourceType": "module" | |
| }, | |
| "env": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ps -ef | grep /var/run/haproxy | grep -v grep | tr -s ' ' | cut -d" " -f2 | while read i; do kill -9 $i; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by narendrasisodiya on 10/02/16. | |
| * Twitter/Github @nsisodiya | |
| */ | |
| //======================== DataBase Description ====================== | |
| var eventName = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var User = { | |
| getData: function(userId, cb){ | |
| AsyncDB.query("GET DATA FOR userId", function(err, data){ | |
| cb(err, data); | |
| }); | |
| } | |
| }; | |
| promisify(User, 'getData');// This will append method called `getDataAsync` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var methods = { | |
| ADD_TODO(state, action){ | |
| return [...state, { | |
| text: action.text, | |
| completed: false | |
| }]; | |
| }, | |
| COMPLETE_TODO(state, action){ | |
| return [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var generatePromise = function () { | |
| var gen = {}; | |
| return { | |
| callback: function (err, data) { | |
| if(err){ | |
| gen.reject(err); | |
| } | |
| gen.resolve(data); | |
| }, | |
| promise: new Promise(function (resolve, reject) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, {Component} from 'react'; | |
| import request from 'superagent-bluebird-promise'; | |
| class AjaxGet extends Component { | |
| constructor(props, context) { | |
| super(props, context); | |
| this.state = { | |
| data: {} | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define(['util'], function () { | |
| 'use strict'; | |
| return { | |
| loadReactComponents: function (id, moduleName) { | |
| var node = document.getElementById(id); | |
| React.render(React.createElement(window.reactComponents[moduleName], null), node); | |
| } | |
| }; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var moduleName = window.location.search.split("?m=")[1]; | |
| if (window.reactComponents[moduleName] === undefined) { | |
| alert("Error, There is no such component I found ," + moduleName); | |
| } else { | |
| var node = document.getElementById('content'); | |
| React.render(React.createElement(window.reactComponents[moduleName], null), node); | |
| } |