Skip to content

Instantly share code, notes, and snippets.

View nickgs's full-sized avatar
👋

Nick Selvaggio nickgs

👋
  • Sego Solutions, LI Blockchain
  • Long Island
  • X @direct
View GitHub Profile
.layout-flex {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.item {
width: 200px;
height: 112px;
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Flexbox layout pattern</title>
<link href="https://fonts.googleapis.com/css?family=Dancing+Script&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href='css/styles.css'/>
<link rel="stylesheet" type="text/css" href='css/layout.css'/>
</head>
<body>
let value = 0;
let pad1;
let pad2;
function setup() {
createCanvas(windowWidth, windowHeight);
background("black");
pad1 = new Pad(10, 100, 232);
pad2 = new Pad(110, 100, 400);
let value = 0;
let pad1;
let pad2;
function setup() {
createCanvas(windowWidth, windowHeight);
background("black");
pad1 = new Pad(10, 10);
pad2 = new Pad(250, 250);
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Flexbox layouts</title>
<link href="https://fonts.googleapis.com/css?family=Dancing+Script&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href='css/styles.css'/>
</head>
<body>
<div class="nav">
@nickgs
nickgs / productData.json
Last active September 22, 2021 21:06
ADC Product API JSON Data
{
"products": [
{
"product": {
"SKU": "216RB",
"title": "<a href=\"/products/216\">Pocket Pal II™</a>",
"Body": "<p><strong>An indispensable uniform accessory that combines fashion with function.</strong></p>\n<p><strong>The 216 Series features:</strong></p>\n<ul>\n<li>\n\t\tWashable 420D white nylon pocket organizer sewn with nylon thread</li>\n<li>\n\t\t5 slide-in and one covered pocket in front, one full-width slide-in pocket in rear</li>\n<li>\n\t\tHandy key ring</li>\n<li>\n\t\tHook and Loop snap closures in choice of 6 vibrant colors</li>\n<li>\n\t\tMeasures 6 1/4\" x 4 3/4\" x 1/4\", Weighs 1 oz</li>\n<li>\n\t\tStandard orders ship in polybag. Optional retail packaging (see photos) also available for a slight upcharge; add a “Q” to the item number when ordering.</li>\n</ul>\n",
"Product Sku Image ": {
"src": "https://www.adctoday.com/sites/default/files/product_images/216RB-web.jpg",
"alt": "",
@nickgs
nickgs / javascript_example.js
Created August 21, 2019 15:49
ADC Product API Javascript Example
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
@nickgs
nickgs / example.java
Created August 21, 2019 15:46
ADC Product API Java example
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.adctoday.com/api/v1/product/700-11ABK")
.get()
.addHeader("User-Agent", "PostmanRuntime/7.15.2")
.addHeader("Accept", "*/*")
.addHeader("Cache-Control", "no-cache")
.addHeader("Host", "www.adctoday.com")
.addHeader("Accept-Encoding", "gzip, deflate")
@nickgs
nickgs / phpexample.php
Last active August 21, 2019 15:44
ADC Product API PHP Curl Example
<?php
$product = "700-11ABK";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.adctoday.com/api/v1/product/{$product}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
@nickgs
nickgs / ShipShooter.js
Last active May 6, 2019 18:16
Our ship shooter game
var ship; // the games ship.
var enemies = [];
function setup() {
createCanvas(800, 600);
ship = new Ship(100, 100);
}