Skip to content

Instantly share code, notes, and snippets.

View ThatGuySam's full-sized avatar
🍉
Discovering the wonders of JAMStack

Sam Carlton ThatGuySam

🍉
Discovering the wonders of JAMStack
View GitHub Profile
@ThatGuySam
ThatGuySam / classGroups.html
Created September 5, 2018 16:46
Class groups for default styles built classes
<!-- Blade -->
<div class="{{ $classList }} {{ $spacingClasses ?? 'm-3' }} {{ $colorClasses ?? 'text-light' }}">
</div>
<!-- Vue -->
<div :class="`${ classList } ${ spacingClasses || 'm-3' } ${ colorClasses || 'text-light' }`">
</div>
@ThatGuySam
ThatGuySam / dev-switcher.js
Created November 1, 2018 20:33
Switches between dev and production resources - Designed to work with Laravel Mix + Valet + Zeit's Now
var sectionId = '';
var isDev;
var assetDomain = 'https://production.now.sh';
if(window.localStorage) {
isDev = localStorage.getItem("isDev");
}
if (isDev) {
@ThatGuySam
ThatGuySam / getContrastYIQ.js
Created November 1, 2018 21:04
Gets a contrasting color based on YIQ equation - Source: https://24ways.org/2010/calculating-color-contrast/
function getContrastYIQ(hexcolor){
var r = parseInt(hexcolor.substr(0,2),16);
var g = parseInt(hexcolor.substr(2,2),16);
var b = parseInt(hexcolor.substr(4,2),16);
var yiq = ((r*299)+(g*587)+(b*114))/1000;
return (yiq >= 128) ? 'black' : 'white';
}
@ThatGuySam
ThatGuySam / una-full-width.css
Last active January 7, 2019 15:36
Una Kravet's Formula for breaking out of a parent container to fill the page's full width https://twitter.com/Una/status/951519740840873984
// Una Kravet's Formula for breaking out of a parent container to fill the page's full width
/*
This can be used to make an element the full-width of the page is *most* cases
Original Idea: https://twitter.com/Una/status/951519740840873984
*/
.una-full-width {
width: 100vw;
@ThatGuySam
ThatGuySam / vimeo-playerjs-methods.txt
Last active January 22, 2019 15:12
A list of methods for the player instance from Vimeo's Player.js as of January 2019
Example: player._addCard(options)
_addCard
_fireEvent
_hideOutro
_overrideControlbarBehavior
_removeCard
_setControlbarVisibility
_setEmailCapture
_setEmbedEditor
@ThatGuySam
ThatGuySam / shortcode-class.php
Created May 16, 2019 14:52
Wordpress Shortcode Class
<?php
class Cool_Shortcode_Name {
static $add_script;
static function init() {
add_shortcode('cool_shortcode_name', array(__CLASS__, 'handle_shortcode'));
add_action('init', array(__CLASS__, 'register_script'));
@ThatGuySam
ThatGuySam / wp-env-color-scheme.php
Last active July 28, 2022 21:26
Set custom admin color scheme for your local Wordpress environment
<?php
// Force Color Scheme for environments
// so that you're less likely to accidentally
// make a DEV update to a Production WordPress
// instance.
add_filter( 'get_user_option_admin_color', 'update_user_option_admin_color', 5 );
function update_user_option_admin_color( $color_scheme ) {
if (defined('WP_LOCAL_DEV') && WP_LOCAL_DEV) return 'ocean';
@ThatGuySam
ThatGuySam / edges.css
Created January 18, 2020 19:34
See edges of all elements on a page
* {
outline: 1px solid red !important;
border: 1px solid red !important;
}
@ThatGuySam
ThatGuySam / vlc-elgato-catpure.md
Last active March 13, 2025 17:30
Windows Shortcut Target for VLC to show Elgato HD60S Video Stream of PS4 Pro

How to Capture an Elgato Device(or any capture device) in VLC


Make a copy of your normal VLC Shortcut and paste this into it's Target under Properties and customize according to you're system and setup.

"C:\Program Files\VideoLAN\VLC\vlc.exe" dshow:// :dshow-vdev="Game Capture HD60 S (Video) (#01)" :dshow-adev="Game Capture HD60 S (Audio) (#01)" :dshow-aspect-ratio="16:9" :dshow-audio-samplerate=48000 :dshow-audio-channels=2 :live-caching=0 :dshow-fps=60

@ThatGuySam
ThatGuySam / allowed-block-types.php
Last active October 31, 2023 08:06
Limit allowed Gutenberg Blocks with full list of native Wordpress Blocks
<?php
// Hook up function to allowed_block_types filter
add_filter( 'allowed_block_types', 'set_allowed_block_types' );
/**
* Set allowed gutenburg block types
* https://rudrastyh.com/gutenberg/remove-default-blocks.html
*/