Skip to content

Instantly share code, notes, and snippets.

@mykt0ngc0
mykt0ngc0 / Gradient.js
Created May 21, 2025 05:22 — forked from jordienr/Gradient.js
Stripe Mesh Gradient WebGL
/*
* Stripe WebGl Gradient Animation
* All Credits to Stripe.com
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
* commented out for now.
* https://kevinhufnagl.com
*/
@mykt0ngc0
mykt0ngc0 / remember-clear-github-access-token.txt
Created May 30, 2022 06:27
Remember/Clear GitHub access token
Remember token:
git config --global credential.helper cache
Clear token cache:
git config --global --unset credential.helper
@mykt0ngc0
mykt0ngc0 / clone-repo-to-non-empty-directory.txt
Last active May 30, 2022 06:25
Clone a repo to non-empty local directory
git init
git remote add origin PATH/TO/REPO
git fetch
git checkout -t origin/dev -f
@mykt0ngc0
mykt0ngc0 / acf_image_local_avatar.php
Created September 2, 2021 09:07 — forked from JiveDig/acf_image_local_avatar.php
Use ACF image field on user profile for WP local avatars
<?php
/**
* Use ACF image field as avatar
* @author Mike Hemberger
* @link http://thestizmedia.com/acf-pro-simple-local-avatars/
* @uses ACF Pro image field (tested return value set as Array )
*/
add_filter('get_avatar', 'tsm_acf_profile_avatar', 10, 5);
function tsm_acf_profile_avatar( $avatar, $id_or_email, $size, $default, $alt ) {
@mykt0ngc0
mykt0ngc0 / plink-plonk.js
Created August 31, 2021 09:42 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@mykt0ngc0
mykt0ngc0 / animatedScrollTo.js
Created August 3, 2021 09:45 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@mykt0ngc0
mykt0ngc0 / acf_modifications.php
Created July 14, 2021 09:08 — forked from courtneymyers/acf_modifications.php
Reduces initial height of Advanced Custom Fields WYSIWYG fields to 100px, and enables autoresizing of WYSIWYG field, as text is entered. Best practice would be to include this function in a site-specific plugin.
<?php
/*
* -----------------------------------------------------------------------------
* Advanced Custom Fields Modifications
* -----------------------------------------------------------------------------
*/
function PREFIX_apply_acf_modifications() {
?>
<style>
@mykt0ngc0
mykt0ngc0 / WP-conditional-css-and-js.php
Last active June 7, 2021 12:22
Selective/Conditional CSS and JS Loading in WordPress. Loads CSS and JS file based on matched page/post slug.
/**
* Selective/Conditional CSS and JS Loading in WordPress
* Loads CSS and JS file based on matched page/post slug
*/
class ConditionalAsset {
private function assetName() {
$post_type = get_post_type();
$slug = get_post_field( 'post_name' );
@mykt0ngc0
mykt0ngc0 / cursor.css
Created February 11, 2021 16:08
Performant custom cursor by 14islands.com
#cursor {
--size: 20px;
position: fixed;
top: 0;
left: 0;
height: var(--size);
width: var(--size);
background-color: #000;
border-radius: 50%;
transform: translate3d(
@mykt0ngc0
mykt0ngc0 / wp-config.php
Created February 3, 2021 04:50
Enable WP_DEBUG only on the front-end.
<?php
/* Enable Debugging (only on front-end) */
$is_admin = strpos($_SERVER['REQUEST_URI'], 'wp-admin');
if ($is_admin == false){
define( 'WP_DEBUG', true );
}
/* That's all, stop editing! Happy publishing. */