Skip to content

Instantly share code, notes, and snippets.

View SunilDy's full-sized avatar
🏠
Working from home

Sunil Kumar SunilDy

🏠
Working from home
View GitHub Profile

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@SunilDy
SunilDy / storeImgInMongoWithMongoose.js
Created May 27, 2019 03:25 — forked from aheckmann/storeImgInMongoWithMongoose.js
store/display an image in mongodb using mongoose/express
/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path
@SunilDy
SunilDy / app.js
Created May 24, 2019 14:48 — forked from stongo/app.js
Joi validation in a Mongoose model
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
db.on('error', function() {
return console.error.bind(console, 'connection error: ');
});
@SunilDy
SunilDy / webdev_online_resources.md
Last active July 19, 2018 10:37 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)