Skip to content

Instantly share code, notes, and snippets.

View m-alikhizar's full-sized avatar
👋
Design, Code and things in between!

Khizar Ali m-alikhizar

👋
Design, Code and things in between!
View GitHub Profile
@m-alikhizar
m-alikhizar / app.js
Last active July 23, 2016 10:42
NodeJS Express Routing
'use strict';
var router = require('./route');
// var error_hander = require('./error_handler');
var express = require('express');
var app = express();
const PORT = 1337;
app.use('/I/want/title/', router);
Verifying that "khizar.id" is my Blockstack ID. https://onename.com/khizar
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
There is no best image format.
JPEG
* Can display about 16.8 million colors
* Lossy Compression
* Cannot be animated
* Great for still images and photographs
GIF
* Can display 256 colors
* Lossless Compression
Stay away from Time wasters.
More focus = more equilibrium
"The most valuable of all talents is that of never using two words when one will do." —Thomas Jefferson
Don’t envy what people have, emulate what they did to have it.
”Courage is what it takes to stand up and speak; courage is also what it takes to sit down and listen.” - Winston Churchill
Part 1
Linux Command Line
As a web developer you are assigned a task to administer Linux based web server or your company says we don't like Windows you must have to choose Mac or Linux based system. Things get worse when you are afraid of command line and hesitate to write commands yourself. This series of articles will help you jump start with command line quickly, easily, and after reading the whole series, you will not fear to run commands yourself.
Prerequisite
I assume you have some basic understanding of Unix/Linux based systems and at least must be comfortable working with the GUI environment of the OS.
Bash
Bash (Bourne Again SHell) is a shell program that interprets the command you enter and decides whether to execute itself, or execute using other binary, or execute a script. Bash is part of GNU project and it's was developed as a replace for sh (Bourne shell) used in Unix. Bash not only comes with Linux but also the default shell for Mac OS X. So the commands which you will learn in this serie
Variables
There are two variable declaration keywords: let which is useful in imperative iteration rather than more functional approach. By default, Const declaration is a signal that tells, "the value assigned to this name is not going to change". It also helps in fully understand what the name means right away, without needing to read the whole function or block scope.
Frameworks and Libraries
Don't define yourself by a framework, library, or coding paradigm. The best engineers are problem solvers first and foremost; Frameworks and libraries are simply tools for solving problems.
Aspire to a be great engineer no matter the language.
Two words are used to combine info from two or more tables:
// --- UNION --- //
Rows are retrieved from one or more tables and stored together,
one after the other, in a single result. For example, if your query selected
6 rows from one table and 5 rows from another table, the result would
contain 11 rows
- All the SELECT queries must select the same number of columns.
- The columns selected in the queries must contain the same type of data.
<noscript>No script text goes here...</noscript>
//true or false
navigator.cookieEnabled
//Win32, MacPPC, MacIntel, X11
//NOTE: MacIntel and X11 are equivalent in case of Safari
navigator.platform
//The indexOf() method returns the position of the first occurrence of a specified value in a string.
stringVar.indexOf( strToSearch, [int start] );