Skip to content

Instantly share code, notes, and snippets.

View czuli's full-sized avatar
🎯
Burn the midnight oil

Łukasz Czulak czuli

🎯
Burn the midnight oil
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active February 23, 2026 17:13
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@yzoja
yzoja / .htaccess
Created January 24, 2022 12:10
Allow Google Cache to access your fonts
######################
## Handling Options for the CORS
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [L,R=204]
###################
## Add custom headers
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
@mmercedes
mmercedes / valheim_debian_server_setup.md
Last active January 24, 2026 12:34
Guide for creating a dedicated valheim server on debian

recommened you do this from within tmux since the steamcmd utility creates its own repl

Install SteamCMD

taken from here

$ sudo useradd -m steam
$ sudo apt update && sudo apt-get install lib32gcc1 -y
$ sudo su - steam
$ mkdir ~/Steam && cd ~/Steam
$ curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
@aliboy08
aliboy08 / functions.php
Created March 5, 2020 06:07
Woocommerce - Single Product Carousel
// Modify single product images: add carousel functionality
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
add_action( 'woocommerce_before_single_product_summary', function(){
global $product;
$image_ids = [];
// featured image
if( has_post_thumbnail() ) $image_ids[] = get_post_thumbnail_id();
@aslamdoctor
aslamdoctor / wp-ajax-loadmore.md
Last active November 22, 2023 00:41
Wordpress - AJAX Load More Steps

Step 1. Load more button

<?php
global $wp_query; // you can remove this line if everything works for you
 
// don't display the button if there are not enough posts
if (  $wp_query->max_num_pages > 1 )
	echo '<div class="misha_loadmore">More posts</div>'; // you can use <a> as well
?>
@noahduncan
noahduncan / functions.php
Last active July 24, 2024 18:10
Automatically Sync ACF Fields on dev environments
<?php
/*
Plugin Name: Zing ACF Auto Sync
Plugin URI:
Description: Plugin that automatically syncs the database with local json for .test urls
Version: 20180419
Author: Noah Duncan <noah@zingstudios.com>
*/
/* Put in /wp-content/mu-plugins/zing-acf-auto-sync/zing-acf-auto-sync.php if you want as a plugin */
@aayushdrolia
aayushdrolia / gist:23b40152f34fa790773ea894fd4d6091
Last active October 14, 2022 06:59
Comment form validation message on the same page in wordpress
***********************************************
PHP CODE (add it in your theme's functions.php)*
***********************************************
function insert_jquery_validate(){
wp_enqueue_script('validate', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js', array( 'jquery' ), false, true );
}
add_filter('wp_enqueue_scripts','insert_jquery_validate');
@ozrabal
ozrabal / index.html
Created October 27, 2016 13:44
Swiper custom slides transform effect
<!-- Swiper -->
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="slide-inner" style="background-image: url('http://cs412624.vk.me/v412624691/4117/RWBNZL6CLtU.jpg')"></div>
</div>
<div class="swiper-slide">
<div class="slide-inner" style="background-image: url('http://cs412624.vk.me/v412624691/41ad/atM6w55Z9Xg.jpg')"></div>
</div>
<div class="swiper-slide">
@galbaras
galbaras / no_urls_allowed.php
Last active October 23, 2024 12:16
Function to invalidate Contact Form 7 input, unless the fields is of type "url" or has "url" in its name, i.e. it is meant for URLs
add_filter( 'wpcf7_validate_text', 'no_urls_allowed', 10, 3 );
add_filter( 'wpcf7_validate_text*', 'no_urls_allowed', 10, 3 );
add_filter( 'wpcf7_validate_textarea', 'no_urls_allowed', 10, 3 );
add_filter( 'wpcf7_validate_textarea*', 'no_urls_allowed', 10, 3 );
function no_urls_allowed( $result, $tag ) {
$tag = new WPCF7_Shortcode( $tag );
$type = $tag->type;
$name = $tag->name;
@ludoo0d0a
ludoo0d0a / gist:8d0cfd1cab22598cb5d8
Created June 11, 2015 18:54
Synology boot locked
Sometimes after a hard reboot (power cut), if your synology cannot be logged in with DSM and it shows "System is getting ready. Please log in later" , please do these steps :
#Admin login via ssh
> synobootseq --set-boot-done
> synobootseq --is-ready
#optional
> /usr/syno/etc/rc.d/S97apache-sys.sh start
> /usr/syno/etc/rc.d/S95sshd.sh start