Skip to content

Instantly share code, notes, and snippets.

View techitesh's full-sized avatar

Hitesh techitesh

  • PearTree.to
  • Ahmedabad
  • 14:15 (UTC +05:30)
View GitHub Profile
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
#
# Updates by Ben Zörb:
# - Works in any project directory
# - Include composer
# - Use yarn if available
#
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
@techitesh
techitesh / server.js
Created June 9, 2018 12:18
Node headers
app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type,Authorizaton');
next();
});
@techitesh
techitesh / app.js
Created June 13, 2018 18:45
vue-select-2-example
const app = new Vue({
el: '#app',
data() {
return {
users: [
{ id: 1, text: '[email protected]' },
{ id: 2, text: '[email protected]' },
],
}
},
@techitesh
techitesh / .eslintrc.js
Created August 2, 2018 09:55
eslintrc configuration
module.exports = {
"plugins": ["promise"],
"extends": ["standard","plugin:promise/recommended","plugin:node/recommended"],
};
@techitesh
techitesh / timestamps.plugin.js
Created August 2, 2018 09:56
mongoose timestamps with moment
/*!
* Mongoose Timestamps Plugin
* Copyright(c) 2012 Nicholas Penree <[email protected]>
* Original work Copyright(c) 2012 Brian Noguchi
* MIT Licensed
*/
var defaults = require('defaults')
const moment = require('moment-timezone')
@techitesh
techitesh / javascript.json
Last active August 3, 2018 08:11
Javascript Snippets
{
"Require co": {
"prefix": "reqco",
"body": [
"const co = require('co')",
"$0"
],
"description": "require Co Package"
},
"Wrap Function in Co": {
@techitesh
techitesh / tsconfig.json
Created September 6, 2018 14:30
tsconfig
{
"compilerOptions": {
"target": "es6",
"noImplicitAny": false,
"rootDir": "./src",
"outDir": "./build",
"sourceMap": false
},
"exclude": [
"node_modules"
@techitesh
techitesh / nodemon.json
Created September 8, 2018 13:03
nodemon
{
"watch": ["src"],
"ext": "ts",
"ignore": ["src/**/*.spec.ts"],
"exec": "ts-node ./src/server.ts"
}
@techitesh
techitesh / tslint.json
Created September 9, 2018 06:54
tslint
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"no-console": true,
"object-literal-sort-keys": false
},
@techitesh
techitesh / summernote.directive.ts
Last active November 23, 2018 06:47
angular-6-summernote-directive
import { Directive, ElementRef, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Directive({
// tslint:disable-next-line:directive-selector
selector: '[summernote]',
})
export class SummernoteDirective implements OnInit {
private element: any;
@Input() config;