Skip to content

Instantly share code, notes, and snippets.

View danivijay's full-sized avatar
💙
https://twitter.com/utmostdev

Dani Vijay danivijay

💙
https://twitter.com/utmostdev
View GitHub Profile

VSCode

{
      "editor.minimap.enabled": false,
      "prettier.tabWidth": 6,
      "prettier.singleQuote": true,
      "prettier.arrowParens": "always",
      "prettier.trailingComma": "all",
      "prettier.eslintIntegration": true,
      "prettier.printWidth": 150,
@danivijay
danivijay / jsx.code-snippets
Created December 31, 2018 11:31
VS Code snippet to disable ESLint
"jsx_eslint_disable": {
"prefix": "eslint_disable_jsx",
"body": ["{/* eslint-disable */}", "{/* eslint-enable */}"],
"description": "Eslint Disable for JSX"
}
function numberToWords (n) {
const num = ["zero", "one", "two", "three","four","five","six", "seven", "eight", "nine"]
const first = ["ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "seventeen", "eighteen", "nineteen",]
const second = ["", "", "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninety"]
let output = []
const sNumber = n.toString()
const len = sNumber.length
let str = ''
for (var i = 0; i < len; i += 1) {
output.push(+sNumber.charAt(i));
@danivijay
danivijay / Errors when cloning Wittr or starting Server.md
Last active March 6, 2018 12:19
Errors when cloning Wittr or starting Server

Errors when cloning Wittr or starting Server

Error - Facing-warnings or errors after running server(npm run serve)

Possible Solutions

  • Forgot the npm install command.
  • Clone again.
  • Change the current working directory to wittr.
  • Correct: npm run serve Incorrect: npm run server.
  • Delete the current folder and try installing from scratch.
@danivijay
danivijay / startMessage.js
Created December 16, 2017 12:42
updated version
import chalk from 'chalk';
console.log(chalk.green('Starting app in dev mode...'));
import express from 'express';
import path from 'path';
import open from 'open';
const port = 3000; //choose different, if this port not available
const app = express();
app.get('/',function(req, res) {
res.sendFile(path.join(__dirname, '../src/index.html'));
});
@danivijay
danivijay / webpack.config.dev.js
Created December 13, 2017 15:33
Webpack 3.6 config for dev
import webpack from 'webpack';
import path from 'path';
export default {
devtool: 'inline-source-map',
entry: [
path.resolve(__dirname, 'src/index')
],
target: 'web',
output: {
@danivijay
danivijay / srcServer.js
Last active December 12, 2017 16:11
file to place within buildScripts/
var express = require('express');
var path = require('path');
var open = require('open');
var port = 3000; //choose different, if this port not available
var app = express();
app.get('/',function(req, res) {
res.sendFile(path.join(__dirname, '../src/index.html'));
});
@danivijay
danivijay / .editorconfig
Created December 12, 2017 13:59
.editorconfig by Dani Vijay
#editorconfig.org
root=true
[*]
indent_style = space
indent_size = 2
end_of_line = If
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@danivijay
danivijay / package.json
Last active December 16, 2017 12:16
package.json for Building a JS Development Environment, install 'npm-run-all' first.
{
"name": "javascript-development-environment",
"version": "1.0.0",
"description": "JavaScript Development Environment by Dani Vijay",
"scripts": {
"prestart": "node buildScripts/startMessage.js",
"start": "npm-run-all --parallel security-check open:src",
"open:src": "node buildScripts/srcServer.js",
"security-check": "nsp check",
"localtunnel": "lt --port 3000",