Skip to content

Instantly share code, notes, and snippets.

View Youdaman's full-sized avatar
🥪

Stew Heckenberg Youdaman

🥪
View GitHub Profile
@Youdaman
Youdaman / index.html
Created April 30, 2022 01:36
Parallax Depth Cards
<h1 class="title">Hover over the cards</h1>
<div id="app" class="container">
<card data-image="https://images.unsplash.com/photo-1479660656269-197ebb83b540?dpr=2&auto=compress,format&fit=crop&w=1199&h=798&q=80&cs=tinysrgb&crop=">
<h1 slot="header">Canyons</h1>
<p slot="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</card>
<card data-image="https://images.unsplash.com/photo-1479659929431-4342107adfc1?dpr=2&auto=compress,format&fit=crop&w=1199&h=799&q=80&cs=tinysrgb&crop=">
<h1 slot="header">Beaches</h1>
<p slot="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
# =============================================================================
# An Entity in the world.
# =============================================================================
Entity = ->
@x = 0
@speed = 2
# units/s
@position_buffer = []
return
using BeardedManStudios.Forge.Networking.Generated;
using KinematicCharacterController;
using UnityEngine;
public class PlayerCapsule : PlayerCapsuleBehavior
{
public float speed = 10f;
public KinematicCharacterMotor motor;
public PlayerCapsuleController controller;
public KinematicCharacterMotorState state;
### Keybase proof
I hereby claim:
* I am youdaman on github.
* I am youdaman (https://keybase.io/youdaman) on keybase.
* I have a public key ASDGYBqFNDWV8e2jq4TYXdnB4ziSqE4NMN7ZZ22PW0R0xwo
To claim this, I am signing this object:
console.log("testing")
@Youdaman
Youdaman / WordPress MySQL migration
Created March 21, 2014 03:03
MySQL snippet to update WordPress when moving from one server/directory to another -- replace 'old' and 'new' with respective URLs
UPDATE wp_options SET option_value = replace(option_value, 'old', 'new') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'old','new');
UPDATE wp_posts SET post_content = replace(post_content, 'old', 'new');
@Youdaman
Youdaman / gist:5679872
Last active December 17, 2015 22:09
HTML5 validation for ACF -- to overcome Chrome et al's bug where the browser will focus required fields but not scroll far enough to see the corresponding tooltip validation message below the field if the field is outside the viewport, i.e. below the fold. Works specifically with ACF tabs.
add_action( 'admin_footer-post-new.php', 'html5_validation' );
add_action( 'admin_footer-post.php', 'html5_validation' );
function html5_validation() { ?>
<script type="text/javascript">
jQuery('#title').attr('required',true);
jQuery('#save-post').add('#publish').on('click', function(){
if (jQuery(':invalid').length) {
var invalid = jQuery(':invalid').first();
var label = jQuery('label[for=' + jQuery(invalid).attr('id') + ']');
var div = jQuery(label).parents('div:eq(0)');
@Youdaman
Youdaman / gist:5382328
Last active December 16, 2015 05:09
Batman.CouchStorage -- assumes @encode '_rev' and CouchDB list function that provides JSON with id: row.value._id and _row: row.value._rev
class Batman.CouchStorage extends Batman.RestStorage
Batman.URI.queryFromParams = (data) ->
object = JSON.parse(data)
for property of object
data = JSON.stringify(object[property])
return data
@PostBodyContentType = 'application/json'
serializeAsForm: false