Skip to content

Instantly share code, notes, and snippets.

Avatar
🔧
Building, breaking, and fixing things.

Nick Parsons nparsons08

🔧
Building, breaking, and fixing things.
View GitHub Profile
View build.sql
go build -o passwordless-social .
./passwordless-social
View create.sql
CREATE DATABASE passwordless_social;
\c passwordless_social
View config.js
export default {
env: process.env.NODE_ENV || 'development',
server: {
port: process.env.PORT || 8080,
},
google: {
projectId: '<YOUR_PROJECT_ID>',
bucket: '<YOUR_BUCKET_NAME>',
},
};
View config.js
export default {
env: process.env.NODE_ENV || 'development',
server: {
port: process.env.PORT || 8080,
},
google: {
projectId: '<YOUR_PROJECT_ID>',
bucket: '<YOUR_BUCKET_NAME>',
},
};
View controller.js
import uuid from 'uuid/v4';
import mime from 'mime-types';
import { Storage } from '@google-cloud/storage';
import config from '../config';
exports.create = async (req, res, next) => {
const type = mime.lookup(req.file.originalname);
const storage = new Storage({
View route.js
import uuid from 'uuid/v4';
import multer from 'multer';
import Upload from '../controllers/upload';
import config from '../config';
module.exports = api => {
api.route('/upload').post(multer().single('image'), Upload.create);
};
View serverless-token.js
const client = stream.connect(key, secret);
module.exports.token = (event, context, callback) => {
const data = JSON.parse(event.body);
const token = client.createUserSessionToken(data.user);
const response = {
statusCode: 200,
headers: {
View gist:44c0c465df86105dbf6a1c8c854aacd4
session.feed('user').follow('user', userIdOfUserThatShouldBeFollowed);
View crawl.sh
serverless invoke local --function crawl
You can’t perform that action at this time.