Skip to content

Instantly share code, notes, and snippets.

View philsinatra's full-sized avatar
🤘

Phil Sinatra philsinatra

🤘
View GitHub Profile
@philsinatra
philsinatra / .htmlhintrc
Created April 26, 2023 13:44
HTML Hint Config
{
"alt-require": true,
"attr-lowercase": true,
"attr-no-duplication": true,
"attr-value-double-quotes": true,
"doctype-first": true,
"doctype-html5": true,
"id-unique": true,
"spec-char-escape": true,
"src-not-empty": true,
@philsinatra
philsinatra / make_folders.js
Created April 3, 2023 21:41
Organize images into subfolders
const fs = require('fs');
const path = require('path');
const MAX_FILES_PER_FOLDER = 500;
const IMAGE_EXTENSIONS = ['.png', '.jpg', '.jpeg', '.gif'];
// Get a list of all files in the current directory
const files = fs.readdirSync('.');
// Filter out only the image files
import "./style.css";
const color_data = [
{
name: "red",
hex: "#ff0000",
sound: "sound_1",
},
{
name: "white",
@philsinatra
philsinatra / csc_iv_code_pre.css
Created November 27, 2022 18:08
CSC IV Canvas Source Code
code {
font-family: Menlo, Monaco, "Lucida Console", Consolas, monospace;
font-size: 110%;
margin: 0;
}
pre {
margin: 1em 0;
overflow: auto;
}
pre code {
@philsinatra
philsinatra / vscode.json
Created October 28, 2022 13:15
VSCode preferences
{
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
@philsinatra
philsinatra / +page.svelte
Last active October 12, 2022 19:17
Svelte POST API
<script type="ts">
import { onMount } from 'svelte';
let title: string;
onMount(() => {
try {
fetch('/api/post', {
method: 'post',
headers: { 'Content-Type': 'application/json' },
@philsinatra
philsinatra / shadow.css
Created March 14, 2022 14:20
Layered CSS Box Shadow
.box {
box-shadow:
0 2.8px 2.2px rgba(0, 0, 0, 0.034),
0 6.7px 5.3px rgba(0, 0, 0, 0.048),
0 12.5px 10px rgba(0, 0, 0, 0.06),
0 22.3px 17.9px rgba(0, 0, 0, 0.072),
0 41.8px 33.4px rgba(0, 0, 0, 0.086),
0 100px 80px rgba(0, 0, 0, 0.12);
}
@philsinatra
philsinatra / css-starter.css
Last active January 27, 2021 19:53
CSS Starter
:root {
--color-celery-400: #3da74e;
--color-celery-500: #44b556;
--color-celery-600: #4bc35f;
--color-celery-700: #51d267;
--color-chartreuse-400: #7cc33f;
--color-chartreuse-500: #85d044;
--color-chartreuse-600: #8ede49;
--color-chartreuse-700: #9bec54;
--color-yellow-400: #d2b200;
@philsinatra
philsinatra / eslint-basic
Created November 14, 2019 14:54
Basic ESLint configuration file for quick JS projects/examples
module.exports = {
env: {
browser: true,
es6: true
},
extends: "eslint:recommended",
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly"
},
@philsinatra
philsinatra / tic-tac-toe.py
Created July 9, 2019 15:24
Python Tic Tac Toe Game
#!/usr/local/bin/python3
import random
import time
test_board = ['#', 'X', '0', 'X', '0', 'X', '0', 'X', '0', 'X']
game_board = ['#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']
def display_board(board):