Skip to content

Instantly share code, notes, and snippets.

View Danny-G-Smith's full-sized avatar

Danny G Smith Danny-G-Smith

View GitHub Profile
@Danny-G-Smith
Danny-G-Smith / dabblet.css
Created April 10, 2019 00:34 — forked from csssecrets/dabblet.css
Toggle buttons
/**
* Toggle buttons
*/
input[type="checkbox"] {
position: absolute;
clip: rect(0,0,0,0);
}
input[type="checkbox"] + label {
@Danny-G-Smith
Danny-G-Smith / OneTab Debugging
Created October 20, 2018 01:13
OneTab Debugging
https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall?hl=en | OneTab - Chrome Web Store
https://www.jetbrains.com/phpstorm/?fromMenu | PhpStorm: Lightning-Smart IDE for PHP Programming by JetBrains
https://code.visualstudio.com/download | Download Visual Studio Code - Mac, Linux, Windows
https://editorconfig.org/ | EditorConfig
https://www.jslint.com/ | JSLint: The JavaScript Code Quality Tool
https://codebeautify.org/jsvalidate | Best Online JavaScript Validator
https://phpcodechecker.com/ | PHP Code Checker - Syntax Check for Common PHP Mistakes
http://sandbox.onlinephpfunctions.com/ | PHP Sandbox, test PHP online, PHP tester
https://blog.teamtreehouse.com/mastering-developer-tools-console | Mastering The Developer Tools Console - Treehouse Blog
https://umaar.com/dev-tips/178-quick-pause-script-execution/ | Quick Pause for current script execution - Chrome DevTools - Dev Tips
const COLORS = {
blue: ['#1E88E5', '#90CAF9'],
brown: ['#6D4C41', '#D7CCC8'],
gray: ['#212121', '#BDBDBD'],
green: ['#388E3C', '#A5D6A7'],
red: ['#E53935', '#EF9A9A'],
orange: ['#F4511E', '#FFAB91'],
purple: ['#8E24AA', '#E1BEE7'],
yellow: ['#FFD600', '#FFF59D'],
}
/*
* Modals
*-------------------------------------*/
.modal {
display: none;
z-index: 50;
text-align: center;
background-image: url("../images/sandpaper.png");
<span id="time" class="clock values">2:00</span>
<!--used to test the elaptsed time-->
<!--<span id="theDuration" class="clock values">2:00</span>-->
// must be global variables
let display = document.querySelector('#time');
let twoMinutes = 120;
let timer;
let clockNotRunning = true;
@Danny-G-Smith
Danny-G-Smith / timer.js
Created July 22, 2018 16:39 — forked from Aaronkala/timer.js
Countdown timer with Javascript
function startTimer(duration, display) {
var timer = duration, minutes, seconds;
setInterval(function () {
minutes = parseInt(timer / 60, 10)
seconds = parseInt(timer % 60, 10);
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;
display.textContent = minutes + ":" + seconds;
@Danny-G-Smith
Danny-G-Smith / timestamp.js
Created July 17, 2018 18:18 — forked from hurjas/timestamp.js
Print out a nicely formatted timestamp in JavaScript.
/**
* Return a timestamp with the format "m/d/yy h:MM:ss TT"
* @type {Date}
*/
function timeStamp() {
// Create a date object with the current time
var now = new Date();
// Create an array with the current month, day and time
@Danny-G-Smith
Danny-G-Smith / git-checkout-date.sh
Created July 14, 2018 17:14 — forked from brianjriddle/git-checkout-date.sh
git checkout source code to a specific date
git checkout "`git rev-list master -n 1 --first-parent --before=2008-03-02`"
@Danny-G-Smith
Danny-G-Smith / gh-pages-deploy.md
Created June 20, 2018 20:26 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).