Skip to content

Instantly share code, notes, and snippets.

View bemijonathan's full-sized avatar
🎓
Learning

Jonathan Atiene bemijonathan

🎓
Learning
View GitHub Profile
import { buildSchema, graphql } from "graphql";
// Construct a schema, using GraphQL schema language
let graphqlSchema = buildSchema(`
type Query {
recipes: [Recipe]
recipes_by_pk(id: Int!): Recipe
}
type Recipe {
id: ID!
in cli for local db
-Install postgres (one time only for the psql cli tools)
-Install pg in the working folder of code(postgres for node) npm install pg
-createdb nameofdb
-Install knex in the working folder of code npm install knex (-g first time)
-knex init (gives you the knexfile -see below)
-knex migrate:make 'nameofmigrationsfile' <-- then edit
-knex migrate:latest
-optional for seeding- knex seed:make 'nameofseedfile' <--then edit
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 16, 2025 13:07
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@sd031
sd031 / DevOps related courses with links
Created September 12, 2019 04:14
GCP, AWS Certification, DevOps / DevSecOps courses link that I did go through
@aescarcha
aescarcha / nodeAsyncTest.js
Created September 25, 2018 07:03
Javascript async / await resolving promises at the same time test
// Simple gist to test parallel promise resolution when using async / await
function promiseWait(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
}, time);
});
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MediaCapture and Streams API</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="main.css">
</head>
<body>
<header>
@bradtraversy
bradtraversy / docker-help.md
Last active June 3, 2025 04:00
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@simplesNotEZ
simplesNotEZ / knexCheatsheet.md
Last active September 18, 2020 03:40
Knex Cheatsheet

Set-up github repo for project

-Create a separate repository in github

-Does your project have a package.json yet? If not, create one within your project directory:

$ npm init -y

-Create a .git directory in your project directory:

@adxgun
adxgun / base.go
Created May 3, 2018 11:49
Connect to a postgresql database using GORM
package models
import (
_ "github.com/jinzhu/gorm/dialects/postgres"
"github.com/jinzhu/gorm"
"os"
"github.com/joho/godotenv"
"fmt"
)
@cecilemuller
cecilemuller / launch.json
Last active April 4, 2025 13:08
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Example",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],