Skip to content

Instantly share code, notes, and snippets.

View JoelLisenby's full-sized avatar
🐳
sploosh

Joel Lisenby JoelLisenby

🐳
sploosh
View GitHub Profile
@JoelLisenby
JoelLisenby / find_invisible_horizontal_scroll_elements.js
Last active December 13, 2019 17:36
JavaScript to find hidden horizontal scroll elements. Paste into browser JS console and hit enter.
var docWidth = document.documentElement.offsetWidth;
[].forEach.call(
document.querySelectorAll('*'),
function(el) {
if (el.offsetWidth > docWidth) {
console.log(el);
}
}
);
@JoelLisenby
JoelLisenby / off.reg
Created June 5, 2019 00:46 — forked from CHEF-KOCH/off.reg
Windows 10 ads, turn it off!
Windows Registry Editor Version 5.00
; Turn off File Explorer ads
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"ShowSyncProviderNotifications"=dword:00000000
; Turn off Start Menu suggestions
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager]
"SystemPaneSuggestionsEnabled"=dword:00000000
<div id="hero_video_container">
<video autoplay muted loop id="hero_video">
<source src="/videos/video.mp4" type="video/mp4" />
<source src="/videos/video.webm" type="video/webm" />
</video>
</div>
<style>
#hero_video_container {
position: relative;
width: 100%;
@JoelLisenby
JoelLisenby / ffmpeg.sh
Last active September 6, 2019 16:52
ffmpeg video encoding for web (chrome, firefox, safari, etc)
# h265
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p output.mp4
# h265 with colorspace specified
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 output.mp4
# h265 with colorspace specified and no audio
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -an output.mp4
# webm
@JoelLisenby
JoelLisenby / export_opencart_orders.sql
Last active November 18, 2020 12:57
Queries to export customers and orders from OpenCart as CSV for Import into WooCommerce via WPImportAll plugin
/*
SQL Queries to export customers and orders from OpenCart database as CSV to import into
WooCommerce via the WP All Import plugin with the WooCommerce Add-On
http://www.wpallimport.com/
- Use wp_all_import_templates.txt with the plugin to save column matching time.
- Currently does not import order status
*/
@JoelLisenby
JoelLisenby / new_site.sh
Created January 10, 2019 22:08
Bash script to set up a new project folder for wpengine when using vscode with the sftp extension
#!/bin/bash
echo -e "Domain: \c "
read domain
echo -e "Slug: \c "
read slug
echo -e "Password: \c "
read password
dir="$domain/ftp/public/.vscode"

Hard Reset

  1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
  2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
  3. Release both buttons.
  4. Press the down buttons until the desk beeps one more time or 20 seconds pass.
@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",
@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)