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
| _complete_ssh_hosts () | |
| { | |
| COMPREPLY=() | |
| cur="${COMP_WORDS[COMP_CWORD]}" | |
| comp_ssh_hosts=`cat ~/.ssh/known_hosts | \ | |
| cut -f 1 -d ' ' | \ | |
| sed -e s/,.*//g | \ | |
| grep -v ^# | \ | |
| uniq | \ | |
| grep -v "\[" ; |
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 axios, { setToken } from 'api/axios'; | |
| import token from 'utils/token'; | |
| const path = '/auth'; | |
| const tokenResponseHandler = ({ access, refresh, user }) => { | |
| token.access.set(access); | |
| token.refresh.set(refresh); | |
| setToken(access); |
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 path = require('path') | |
| const axios = require('axios'); | |
| const fs = require('fs'), | |
| // file data from file | |
| FILE_DATA=base64_encode(path.resolve('..', 'CV 6.pdf')); | |
| /** | |
| * HOW TO Make an HTTP Call - POST | |
| */ | |
| // do a POST request |
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
| (async () => { | |
| let a = 0; | |
| const func = (...args) => { | |
| a++; | |
| return new Promise((res, rej) => { | |
| setTimeout(() => res('ok'), 1000) | |
| // setTimeout(() => rej('fuck'), 1000) | |
| }) | |
| } |
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 path = require('path'); | |
| const Transport = require('winston-transport'); | |
| const winston = require('winston'); | |
| const moment = require('moment'); | |
| const db = require('../models'); | |
| const { format } = winston; | |
| const { | |
| combine, |
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 fs = require('fs'); | |
| const db = require('../models'); | |
| console.log('Start creating migration files...'); | |
| /* eslint-disable guard-for-in,no-restricted-syntax */ | |
| for (const model in db) { | |
| const { attributes } = db[model]; | |
| for (const column in attributes) { | |
| delete attributes[column].Model; |
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 functions = require('firebase-functions'); | |
| const nodemailer = require('nodemailer'); | |
| // // Docs | |
| // // https://firebase.google.com/docs/functions/write-firebase-functions | |
| // | |
| exports.sendSupportEmail = functions.https.onRequest(async (request, response) => { | |
| const transporter = nodemailer.createTransport({ | |
| host: 'send.one.com', |
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
| # some imports | |
| @login_required | |
| def provide_addinfo(request): | |
| """ | |
| Allows the user to provide a due date and any additional info for an order. | |
| """ | |
| if request.method == 'POST': | |
| form = OrderForm(data=request.POST, request=request) | |
| if form.is_valid(): # set session vars |
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
| /* eslint-disable no-param-reassign */ | |
| const { hashPassword } = require('../auth/helpers'); | |
| module.exports = (sequelize, DataTypes) => { | |
| const User = sequelize.define('user', { | |
| email: { | |
| type: DataTypes.STRING, | |
| validate: { | |
| isEmail: { | |
| msg: 'Email isn\'t correct' |
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 Sequelize = require('sequelize'); | |
| const models = require('require-dir')(); | |
| const env = process.env.NODE_ENV || 'development'; | |
| const config = require('../../config/database')[env]; | |
| const db = {}; | |
| let sequelize; | |
| if (config.use_env_variable) { |
NewerOlder