Skip to content

Instantly share code, notes, and snippets.

View bystrzan's full-sized avatar

Paul Bystrzan bystrzan

  • UXBox - handcrafted digital goods
View GitHub Profile
@bystrzan
bystrzan / index.html
Created September 16, 2024 14:07
Untitled
<div class="container">
<div id="calendar"></div>
<div class="sidebar" id="eventSidebar"></div>
</div>
<script type="text/javascript">
window.calendarOptions = {
initialView: "multiMonthYear",
// Removed direct plugin references from the window object
headerToolbar: {
<!-- wp:greenshift-blocks/row {"id":"gsbp-74fa7937-2b97","align":"full","width":[80,null,null,null],"widthUnit":["rem","px","px","px"],"displayStyles":false,"background":{"backgroundState":"Gradient","gradient":"linear-gradient(180deg,rgba(227,249,255,0.74) 0%,rgb(250,250,250) 100%)"},"spacing":{"margin":{"values":{},"unit":["px","px","px","px"],"locked":false},"padding":{"values":{"top":["180px"],"bottom":["4"]},"unit":["rem","px","px","px"],"locked":false}},"customAnchor":"start","className":"has-animation"} -->
<div id="gspb_row-id-gsbp-74fa7937-2b97" class="gspb_row gspb_row-id-gsbp-74fa7937-2b97 wp-block-greenshift-blocks-row alignfull has-animation gspb_row-id-gsbp-74fa7937-2b97"><div id="start"></div><div class="gspb_row__content"> <!-- wp:greenshift-blocks/row-column {"id":"gsbp-a74daba9-492d","flexbox":{"enable":false,"marginUnit":["px","px","px","px"],"marginLock":false,"marginTop":[null,null,null,null],"marginBottom":[null,null,null,null],"marginLeft":[null,null,null,null],"marginRight":[null,null,
@bystrzan
bystrzan / index.html
Created December 19, 2019 14:44
Staggered animation with custom properties
<div class="el"></div>
<div class="el"></div>
<div class="el"></div>
<div class="el"></div>
<div class="el"></div>
<div class="el"></div>
<div class="el"></div>
<div class="el"></div>
<div class="el"></div>
<div class="el"></div>
@bystrzan
bystrzan / index.html
Created January 3, 2019 16:25
Vimeo Playlister
<div id="player"></div>
@bystrzan
bystrzan / better-font-smoothing.css
Created January 16, 2018 22:45 — forked from hsleonis/better-font-smoothing.css
Better font smoothing in cross browser
html {
/* Adjust font size */
font-size: 100%;
-webkit-text-size-adjust: 100%;
/* Font varient */
font-variant-ligatures: none;
-webkit-font-variant-ligatures: none;
/* Smoothing */
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
javascript:Array.prototype.slice.call(document.querySelectorAll(%27input%5Btype%3Dpassword%5D%27)).map(function(el)%7Bel.setAttribute(%27type%27,%27text%27)%7D)
<?php
add_filter( 'woocommerce_package_rates', 'custom_package_rates', 10, 2 );
function custom_package_rates( $rates, $package ) {
unset( $rates['flexible_shipping_6_7'] ); // po value na inpucie
unset( $rates['shipping_method_0_flexible_shipping_6_7'] ); // z braku laku próbowałem i po id (id wyciągnięte z wyrenderowanego html'a)
unset( $rates['flat_rate:7'] ); // - 7 to id przy edycji - jest jeszcze "instancja" - w tym wypadku 6
return $rates;
}
@bystrzan
bystrzan / Woo
Created December 14, 2017 22:02
add_filter( 'woocommerce_package_rates', 'tl_shipping_on_price', 10, 2 );
function tl_shipping_on_price( $rates, $package ) {
$total = WC()->cart->cart_contents_total;
if( $total <= 100 ) {
// unset... ale co?
}
return $rates;
}
@bystrzan
bystrzan / custom-post-type-description
Created October 6, 2017 04:38 — forked from schalkjoubert/custom-post-type-description
Custom Post Type Archive Description Field
//http://wpsettingsapi.jeroensormani.com/
add_action( 'admin_menu', 'tsumtour_add_admin_menu' );
add_action( 'admin_init', 'tsumtour_settings_init' );
function tsumtour_add_admin_menu( ) {
add_submenu_page( 'edit.php?post_type=tour', 'Tour', 'Intro', 'manage_options', 'tour', 'tsumtour_options_page' );
}
function tsumtour_settings_init( ) {
register_setting( 'pluginPage', 'tsumtour_settings' );
add_settings_section(
'tsumtour_pluginPage_section',
//Auto add and update Title field:
function my_post_title_updater( $post_id ) {
$my_post = array();
$my_post['ID'] = $post_id;
$my_post['post_name'] = '';
$posttypes = array( 'accommodation', 'destination' );
$currentposttype = get_post_type($post_id);
if ( in_array( $currentposttype, $posttypes ) ) {