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 / vt_resize.php
Last active December 23, 2023 04:33 — forked from seedprod/vt_resize.php
Resize WordPress images on the fly vt_resize w/ multisite support
<?php
/*
* Resize images dynamically using wp built in functions.
* Update: Use WP_Image_Editor class instead of deprecated image_resize.
* Updated by Joel Lisenby (original function by Victor Teixeira)
*
* php 5.2+
*
* Example use:
*
@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>
@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
main {
display: block;
width: 1000px;
height: 50px;
margin: 0 auto;
background-color: red;
}
@media (max-width: 980px) {
main {
@JoelLisenby
JoelLisenby / archlinux.md
Last active October 31, 2022 06:51
Arch Linux Install
@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 / 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 / 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 / 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)