Skip to content

Instantly share code, notes, and snippets.

View cmd-save's full-sized avatar

Beast Node cmd-save

  • Nature Inc.
  • Earth
View GitHub Profile
@cmd-save
cmd-save / example2.js
Created August 23, 2017 15:28
example2
hello(); // Hello there
function hello() {
console.log("Hello there");
}
@cmd-save
cmd-save / example1.js
Created August 23, 2017 15:20
example1
var animal = 'dog';
function whatAnimal() {
console.log(animal); // undefined (not dog)
var animal = 'cow';
console.log(animal); // cow
}
@cmd-save
cmd-save / .eslintrc.js
Last active October 11, 2018 01:57
Eslint config
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"globals": {
"nconf": true
},
"parser": "babel-eslint",
@cmd-save
cmd-save / settings.json
Created March 29, 2017 09:19
SublimeLinter Settings
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"eslint": {
@cmd-save
cmd-save / .eslintrc.js
Created March 28, 2017 03:49 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@cmd-save
cmd-save / reactjsStarter.md
Created September 27, 2016 08:24
About ReactJS

Why React?

React is a JavaScript library for creating user interfaces by Facebook and Instagram. Many people choose to think of React as the V in MVC.

We built React to solve one problem: building large applications with data that changes over time.

Simple

Simply express how your app should look at any given point in time, and React will automatically manage all UI updates when your underlying data changes.

@cmd-save
cmd-save / NodeJsStarter.md
Created September 26, 2016 11:20
NodeJs Starter

What is NodeJs

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Features of Node.js

Following are some of the important features that make Node.js the first choice of software architects.

Asynchronous and Event Driven − All APIs of Node.js library are asynchronous, that is, non-blocking. It essentially means a Node.js based server never waits for an API to return data. The server moves to the next API after calling it and a notification mechanism of Events of Node.js helps the server to get a response from the previous API call.

Very Fast − Being built on Google Chrome's V8 JavaScript Engine, Node.js library is very fast in code execution.

var arrayObj=[
{name:'Aaron',age:20},
{name:'Michael',age:15},
{name:'Meriam',age:18}
]
function compare(a,b) {
if (a.age < b.age)
return -1;
if (a.age > b.age)
Sometimes there are modules that you created or you forked from other developer and you modify it to fit your needs.
I was on same exat scenario. The steps below will guide you on how to install modules in your application using link from github.
*Steps
1. Login to your github account
2. Go to your module repository
3. On your repository page there should be a button "Download ZIP".
--- Note: Others suggested that you can just copy the "https" or "ssh" link and do "npm install git+<https/ssh link>".
However this does not worked for me. Going back to "Download ZIP" button. Right click it and "Copy Link Address" (Im using chrome browser by the way).
4. Before you do an npm install make sure you change some parts of your link.
@cmd-save
cmd-save / React debug setState() warning
Last active February 24, 2016 01:51
React debug setState() warning
Paste this on your browser console and navigate to routes without refreshing your browser.
Once this is inplace whenever you get Warning on setState() it should give you the stack trace.
var warn = console.warn;
console.warn = function(warning) {
if (/(setState)/.test(warning)) {
throw new Error(warning);
}
warn.apply(console, arguments);
};