Skip to content

Instantly share code, notes, and snippets.

@Mandonglawrence
Mandonglawrence / docker-help.md
Created September 21, 2020 09:49 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

MongoDB query exercise

working with Chinh Le @ https://github.com/ldchinhcr

  1. display all the documents in the collection restaurants.

db.rest.find()

  1. display the fields restaurant_id, name, borough and cuisine for all the documents in the collection restaurant.
@Mandonglawrence
Mandonglawrence / app.js
Created September 8, 2020 08:58 — 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: ');
});
(1) percentage of global sales in North America:
SELECT (SUM(NA_Sales)
/(sum(na_sales)+sum(EU_Sales)+sum(JP_Sales)+sum(Other_Sales)))*100
FROM consoleGames
(2) SELECT Name FROM ConsoleGames
ORDER BY Platform ASC, Year DESC
(3) first four letter of console game publisher:
SELECT substr(Publisher,1,4) FROM ConsoleGames
@Mandonglawrence
Mandonglawrence / deploy-static-site-heroku.md
Created May 23, 2020 01:32 — forked from wh1tney/deploy-static-site-heroku.md
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

@Mandonglawrence
Mandonglawrence / graph.js
Created May 13, 2020 19:45 — forked from tpae/graph.js
JavaScript implementation of Graph Data Structure
// Implement a Graph
// basic operations:
// - add vertex (node)
// - add edge (node -> node)
function GraphNode(val) {
this.val = val;
this.edges = {};
}
@Mandonglawrence
Mandonglawrence / media-query.css
Created December 8, 2019 10:57 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS