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 / .block
Created February 2, 2019 04:22 — forked from mbostock/.block
Polar Plot
license: gpl-3.0
@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
<!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 / 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"
@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 / 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 / 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;
// Gets Link for Theme Song
var audioElement = document.createElement("audio");
audioElement.setAttribute("src", "Assets/captainplanet24.mp3");
// Theme Button
$("#musicControls").on("click", ".theme-button", function() {
audioElement.play();
}).on("click", ".pause-button", function() {
audioElement.pause();
});
// Keyboard move controls
$(document).keyup(function(e) {
switch (e.which) {
// Move Buttons (Keyboard Down)
case 40:
captainPlanet.animate({ top: "+=200px" }, "normal");
break;
// Move Buttons (Keyboard Right)
<div id="drink-options"></div>
<script type="text/javascript">
// Array holds all of the drinks available
var drinkList = [
"Coffee: $5",
"Espresso: $7",
"Cappuccino: $6",
"Latte: $4",