This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| "env": { | |
| "es6": true, | |
| "node": true | |
| }, | |
| "extends": "eslint:recommended", | |
| "extends": "eslint:recommended", | |
| "env": { | |
| "node": true | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function isCyclic(obj) { | |
| var keys = []; | |
| var stack = []; | |
| var stackSet = new Set(); | |
| var detected = false; | |
| function detect(obj, key) { | |
| if (typeof obj != 'object') { return; } | |
| if (stackSet.has(obj)) { // it's cyclic! Print the object and its locations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Brew link node | |
| alias node6='brew unlink node@8 && brew link node@6 --force --overwrite'; | |
| alias node8='brew unlink node@6 && brew link node@8 --force --overwrite'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const jwt = require('jsonwebtoken'); | |
| const passport = require('passport'); | |
| const config = require('../config/config'); | |
| const validateEmail = require('../utils/helpers.js').validateEmail; | |
| const validatePassword = require('../utils/helpers.js').validatePassword; | |
| function signToken(req, res, err, user, info) { | |
| if (err || !user) { | |
| return res.status(400).json({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function CalculateDistance(lat1, lon1, lat2, lon2) { | |
| function toRad(x) { | |
| return x * Math.PI / 180; | |
| } | |
| let R = 6371000; // set formula in metres | |
| // Magic | |
| let x1 = lat2 - lat1; | |
| let dLat = toRad(x1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Linux ### | |
| *~ | |
| # temporary files which can be created if a process still has a handle open of a deleted file | |
| .fuse_hidden* | |
| # KDE directory preferences | |
| .directory | |
| # Linux trash folder which might appear on any partition or disk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| option_settings: | |
| aws:elasticbeanstalk:container:nodejs: | |
| NodeCommand: "npm start" | |
| NodeVersion: 8.11.4 | |
| files: | |
| /etc/nginx/conf.d/proxy.conf: | |
| mode: "000644" | |
| owner: root | |
| group: root | |
| content: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import config from 'newseed/config/environment'; | |
| import { inject as service } from '@ember/service'; | |
| import RSVP from 'rsvp'; | |
| import EmberObject from '@ember/object'; | |
| import PromiseMixin from 'ember-promise/mixins/promise'; | |
| import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin'; | |
| var RESTAdapter = EmberObject.extend(DataAdapterMixin, { | |
| simpleStore: service(), | |
| session: service('session'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // These scripts allow you to scrub your twitter account clean by deleting unliking | |
| // and unretweeting everything. Only works on the old twitter web interface. Currently | |
| // you can enable this by going to your menu and selecting to use legacy mode. | |
| // delete tweets | |
| setInterval( | |
| function() { | |
| t = $( '.js-actionDelete button' ); // get delete buttons | |
| for ( i = 0; true; i++ ) { // count removed | |
| if ( i >= t.length ) { // if removed all currently available |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const winston = require('winston'); | |
| const transports = { | |
| console: new winston.transports.Console({ | |
| level: process.env.NODE_ENV === 'production' ? 'error' : 'debug', | |
| handleExceptions: true, | |
| format: winston.format.simple(), | |
| colorize: true, | |
| }), | |
| file: new winston.transports.File({ |