Skip to content

Instantly share code, notes, and snippets.

View parwatcodes's full-sized avatar

Parwat Kunwar parwatcodes

View GitHub Profile
@parwatcodes
parwatcodes / instance.js
Created October 10, 2017 11:49
creating an instance of constructor function without using new keyword
function Call() {
if (this instanceof Call) {
this.a = 1;
this.b = 2;
} else {
return new Call()
}
}
@parwatcodes
parwatcodes / style.css
Created October 12, 2017 14:51
style.css main css file ho tesaile mediqquery sabai yesma huncha harek device ko lagi width milaunu parcha
/* Global properties ======================================================== */
html, body {width:100%; padding:0; margin:0;}
body {font: 14px/25px Arial, Helvetica, sans-serif;color:#292929;min-width:960px;background: url(../images/bg.gif) center 0 repeat;border-top:#292929 6px solid;}
.ic {border:0;float:right;background:#fff;color:#f00;width:50%;line-height:10px;font-size:10px;margin:-220% 0 0 0;overflow:hidden;padding:0}
.main {width:960px; margin:0 auto; position:relative;}
/***********************************************************************/
a {text-decoration:none; cursor:pointer;}
a:hover {text-decoration:none;}
a.button {background:#f4f4f4; font-size:14px; line-height:18px; color:#01a5ca; text-transform:uppercase; display:inline-block; padding:12px 16px 13px 16px; }
var _ = require('lodash');
var groups = {
"BTC/USD": [
{
"pair": "BTC/USD",
"exchange_type": "cex",
"high": 18800,
"low": 14500
},
{
@parwatcodes
parwatcodes / arrayUpdate.js
Last active February 1, 2018 04:54
3 approaches for updating an array, there are many more
const _ = require('lodash');
const projects = [
{
value: "jquery",
label: "jQuery",
desc: "the write less, do more, JavaScript library",
icon: "jquery_32x32.png"
},
{
value: "jquery-ui",
const winston = require('winston');
const config = require('winston/lib/winston/config');
const dateFormat = require('dateformat');
const fs = require('fs');
const path = require('path');
const moment = require('moment');
require('winston-daily-rotate-file');
const DIR_NAME = path.resolve('Logs');
`user {
name
age
}`
can be written as
`viewer {
name
@parwatcodes
parwatcodes / partner.json
Created July 3, 2018 04:53
Uncaught Error: schema should be object or boolean
{
"$id": "http://test-schemas.credi.com/local/schemas/models/partner.json",
"$schema": "http://json-schema.org/draft-07-wip/hyper-schema#",
"base": "http://api.credi.local",
"title": "Partner schema",
"description": "Member schema",
"type": "object",
"properties": {
"partner_guid": {
"type": "string",
@parwatcodes
parwatcodes / fishonmac.txt
Last active September 5, 2018 18:26
best list of mac commnads
brew install fish
install oh my fish to install fenv
https://github.com/oh-my-fish/oh-my-fish
----------------------------------------
install fisherman, to install nvm
chsh -s /usr/local/bin/fish
@parwatcodes
parwatcodes / commands.md
Last active September 6, 2018 17:34
helpful terminal commands

Navigating and Working with Files & Directories


cd - navigate to different directories

pwd - see the name of the current directory

ls - lists all files in the current directory

//
// NaviApple.swift
// navi-apple
//
// Created by mac on 9/11/18.
// Copyright © 2018 Enliv. All rights reserved.
//
import Foundation
import WebKit