Skip to content

Instantly share code, notes, and snippets.

View JoelLisenby's full-sized avatar
🐳
sploosh

Joel Lisenby JoelLisenby

🐳
sploosh
View GitHub Profile
var container;
var camera, scene, renderer;
var mouseX = 0, mouseY = 0;
var windowHalfX = window.innerWidth / 2;
var windowHalfY = window.innerHeight / 2;
init();
animate();
@JoelLisenby
JoelLisenby / index.html
Last active July 7, 2017 18:33
The basic responsive html template.
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Tab Title</title>
main {
display: block;
width: 1000px;
height: 50px;
margin: 0 auto;
background-color: red;
}
@media (max-width: 980px) {
main {
@JoelLisenby
JoelLisenby / ajax.js
Last active October 13, 2017 22:22
Simple Ajax Call
/**
Example Ajax Call
**/
var ExampleClass = function() {
var ec = this; // for access inside the ajax response function.
ec.init = function() {
ec.requestJSON( 'http://jsfiddle.net/echo/jsonp/?banana=delicious', ec.processData );
};
@JoelLisenby
JoelLisenby / pagination.php
Last active November 28, 2017 05:41
A super clean pagination function
<?php
/* pagination($limit, $page, $total)
Designed for clean urls with a /slug/page/2 format
*/
function pagination($current_url, $limit = 10, $page = 1, $total = 100) {
if($total > $limit && $page !== 'all') {
// pagination
$prevpage = ($page - 1 > 0 && $page > 2 ? '/page/'. ($page - 1) : '');
$prev = preg_replace('/\/page\/[0-9]*/', $prevpage, $current_url);
$nextpage = ($page * $limit < $total ? '/page/'. ($page + 1) : '');
@JoelLisenby
JoelLisenby / optimize.sh
Last active April 5, 2018 16:22
Optimize all jpg and png images in current directory and sub-directories recursively with imagemagick mogrify to google pagespeed spec.
#!/bin/sh
find . -name '*.jpg' -execdir mogrify -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB -format jpg {} \;
find . -name '*.png' -execdir mogrify -strip {} \;
@JoelLisenby
JoelLisenby / pioneer_vsx-80_telnet_commands.txt
Created July 10, 2017 22:03
Pioneer VSX-80 Telnet Commands
Connect:
telnet 192.168.1.XXX
Volume:
VD = VOLUME DOWN
MZ = MUTE ON/OFF
VU = VOLUME UP
?V = QUERY VOLUME
@JoelLisenby
JoelLisenby / wp_migration.md
Last active April 10, 2018 19:47
WordPress Site Migration

WordPress Site Migration

Step 1: Backup Dev Site

  • dump database mysqldump -u user_name -p db_name > database_dev.sql
  • files_dev.zip/tar.gz all website files and folders zip -r files_dev.zip /var/www/
  • Store in directory outside of public directory cp files_dev.zip ~/site-backup/ && cp database_dev.sql ~/site-backup/

Step 2: Backup Live Server

  • dump database mysqldump -u user_name -p db_name > database_live.sql
  • files_live.zip/tar.gz all website files and folders zip -r files_live.zip /var/www/
@JoelLisenby
JoelLisenby / gdpr.md
Last active May 4, 2018 21:50
GDPR Summary

General Data Protection Regulation [GDPR] Summary

Must have and store the lawful basis of processing for each contact.

  • Consent (opt-in)
    • Must be told (notified) of what they are opting into.
    • Needs to affirmatively opt-in with an unchecked box. (only opts in for what they were notified they are opting into, not everything you want to send.)
    • Consent must be granular, covering the various ways you use the users data (e.g. email, calls).
    • Must log auditable evidence of what the user consented to: the notice and when they consented.
  • Performance of a contract (customer you need to send bills to)
  • Legitimate interest (customer you want to send products related to what they have)
@JoelLisenby
JoelLisenby / lighthouse-accessibility-audit-ids.txt
Created August 14, 2018 20:11
Lighthouse Accessibility Audit IDs
"accesskeys",
"aria-allowed-attr",
"aria-required-attr",
"aria-required-children",
"aria-required-parent",
"aria-roles",
"aria-valid-attr-value",
"aria-valid-attr",
"audio-caption",
"button-name",