Skip to content

Instantly share code, notes, and snippets.

View perfettiful's full-sized avatar
🎯
Focusing

Nathan Perfetti perfettiful

🎯
Focusing
View GitHub Profile
@perfettiful
perfettiful / randomNumFct.txt
Last active April 5, 2018 23:11
Generate Random Int Fct
//Random Number between Min and Max
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
@perfettiful
perfettiful / setTimer_Slideshow_jQuery.js
Last active April 7, 2018 15:52
setTimer Slideshow in jQuery
// Slideshow Activity
// Students: follow the instructions below:
// TODO: Put links to our images in this image array.
var images = ["images/bootstrap.png",
"images/github-logo.jpg",
"images/logo_JavaScript.png"];
// Variable showImage will hold the setInterval when we start the slideshow
var showImage;
@perfettiful
perfettiful / jQueryAJAX.js
Created April 11, 2018 23:07
jQuery AJAX
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
// The below code fills in the first row of the table
var movie = "Mr. Nobody";
var queryURL = "https://www.omdbapi.com/?t=" + movie + "&y=&plot=short&apikey=trilogy";
$.ajax({
url: queryURL,
method: "GET"
}).then(function(response) {
@perfettiful
perfettiful / myscript.sh
Created May 17, 2018 23:14 — forked from bradtraversy/myscript.sh
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
<!DOCTYPE html>
<html>
<head><title>SOUND</title></head>
<body>
<div>Frequence: <span id="frequency"></span></div>
<script type="text/javascript">
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var oscillatorNode = audioCtx.createOscillator();
var gainNode = audioCtx.createGain();
@perfettiful
perfettiful / repoterm.txt
Created November 4, 2018 00:35
Create Github Repo from Terminal
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:alexpchin/<reponame>.git
git push -u origin master
##Push an existing repository from the command line
git remote add origin git@github.com:alexpchin/<reponame>.git
git push -u origin master
@perfettiful
perfettiful / .block
Created February 2, 2019 04:22 — forked from mbostock/.block
Polar Plot
license: gpl-3.0
@perfettiful
perfettiful / deploy-django.md
Created January 6, 2021 00:43 — forked from rmiyazaki6499/deploy-django.md
Deploying a Production ready Django app on AWS

Deploying a Production ready Django app on AWS

In this tutorial, I will be going over to how to deploy a Django app from start to finish using AWS and EC2. Recently, my partner Tu and I launched our app Hygge Homes (a vacation home rental app for searching and booking vacation homes based off Airbnb) and we wanted to share with other developers some of the lessons we learned along the way.

Following this tutorial, you will have an application that has:

  • An AWS EC2 server configured to host your application
  • SSL-certification with Certbot
  • A custom domain name
  • Continuous deployment with Github Actions/SSM Agent
https://qd63qcai7ta411io-4710885.shopifypreview.com
@perfettiful
perfettiful / gist:ec7e62af11730678c44a7180b9dc5d11
Created May 24, 2021 16:17
Node/Express extract Query params from Req
=========================
for (const key in req.query) {
console.log(key, req.query[key])
}
=========================
The query string is the part that comes after the URL path, and starts with a question mark ?.