Skip to content

Instantly share code, notes, and snippets.

Muhammad Kamran smkamranqadri

Block or report user

Report or block smkamranqadri

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
smkamranqadri / main.js
Last active Sep 27, 2018
Sample Electron Main.js file.
View main.js
const { app, BrowserWindow } = require('electron');
const path = require('path');
const url = require('url');
let win = null;
function createWindow() {
// Initialize the window to our specified dimensions
View vscode_setting_eslint_prettier
"files.autoSave": "onFocusChange",
"editor.formatOnSave": true,
"editor.formatOnType": true,
"eslint.autoFixOnSave": true,
"eslint.enable": true,
"prettier.singleQuote": true,
View .eslintrc
"extends": ["airbnb", "prettier", "prettier/react"],
"plugins": ["prettier"],
"rules": {
"react/jsx-filename-extension": [
"extensions": [".js", ".jsx"]
smkamranqadri / express-server.js
Created Dec 1, 2017
Two questions... 1. How you can improve this code? 2. Do you validate the param is available?
View express-server.js
app.get('/users/:id', (req, res) => {
const userId =
if (!userId) {
return res.sendStatus(400).json({
error: 'Missing id'
Users.get(userId, (err, user) => {
if (err) {
return res.sendStatus(500).json(err)
You can’t perform that action at this time.