This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple PowerShell script to iterate files in a folder, look for the defined RAW-file extension and see if it has an accompanying .JPG-file | |
# If it does not, move it into the "clean"-folder | |
# Create folder selector | |
Add-Type -AssemblyName System.Windows.Forms | |
$browser = New-Object System.Windows.Forms.FolderBrowserDialog | |
$null = $browser.ShowDialog() | |
# Store selected path in var | |
$path = $browser.SelectedPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Providers, ProviderState, SimpleProvider } from '@microsoft/mgt-element'; | |
import { acquireGraphAccessToken } from 'authConfig'; | |
import { authProvider } from 'index'; | |
const provider = new SimpleProvider(() => acquireGraphAccessToken(authProvider)); | |
Providers.globalProvider = provider; | |
Providers.globalProvider.setState(ProviderState.SignedIn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-12-22T08:42:40.120Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Roots Sage 8.4.2 Assets loader for PHP 5.3 in the off case that you have to be compatible with such old versions. | |
* Remember to replace [] arrays with array() in other files. And change short echo <?= to <?php echo. | |
* Other than that Sage is compatible with PHP 5.3 | |
*/ | |
namespace Roots\Sage\Assets; | |
/** | |
* Get paths for assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* An ugly hack to change Visual Composer default columns output to md instead of sm. Changes ALL of them so be careful. | |
* Still a better way than using the custom design options in Visual Composer that outputs a large, un-minified, custom-styles even if you only change the mobile breakpoint. | |
*/ | |
add_filter( 'vc_shortcodes_css_class', 'custom_css_classes_for_vc_row_and_vc_column', 10, 2 ); | |
function custom_css_classes_for_vc_row_and_vc_column( $class_string, $tag ) { | |
if ( $tag == 'vc_column' || $tag == 'vc_column_inner' ) { | |
$class_string = preg_replace( '/vc_col-sm-(\d{1,2})/', 'vc_col-md-$1', $class_string ); // This will replace "vc_col-sm-%" with "vc_col-md-%" | |
} | |
return $class_string; // Important: you should always return modified or original $class_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Tvinga order_comments om en produkt finns i korgen som har "ticket" som kategori. Annars släpp förbi utan information. | |
*/ | |
add_action('woocommerce_checkout_process', 'order_notes_if_ticket'); | |
function order_notes_if_ticket( $order_id ){ | |
global $woocommerce; | |
//$categories[]; | |
foreach ($woocommerce->cart->cart_contents as $key => $values ) { | |
$terms = wp_get_post_terms( $values['product_id'], 'product_cat' ); | |
foreach ( $terms as $term ) $categories[] = $term->slug; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove if you're not checking the input in org_number | |
include_once( get_stylesheet_directory() . '/pnum.php'); // get from: https://github.com/gurre/php-personnummer/blob/master/pnum.php | |
add_action( 'woocommerce_after_checkout_billing_form', 'cheque_custom_checkout_field' ); | |
function cheque_custom_checkout_field( $checkout ) { | |
echo '<div id="cheque_custom_checkout_field"><h3>' . __('Fakturauppgifter') . '</h3>'; | |
woocommerce_form_field( 'org_number', array( | |
'type' => 'text', | |
'class' => array('org-number-field my-field-class form-row form-row-wide'), | |
'label' => __('Organisationsnummer'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( function() { | |
// quick search regex | |
var qsRegex; | |
// init Isotope | |
var $grid = $('.grid').isotope({ | |
itemSelector: '.element-item', | |
layoutMode: 'fitRows', | |
filter: function() { | |
return qsRegex ? $(this).data("category").match( qsRegex ) : true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
var formfield = null; | |
$('#upload_image_button').click(function() { | |
$('html').addClass('Image'); | |
formfield = $(this).prev('input').attr('name'); | |
formfield_id = $(this).prev('input').attr('id'); | |
tb_show( '', 'media-upload.php?type=image&TB_iframe=true' ); | |
return false; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add to functions.php or wherever you extend your functionality. | |
function featuredtoRSS($content) { | |
global $post; | |
if ( has_post_thumbnail( $post->ID ) ){ | |
$content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => '' ) ) . '</div>' . $content; | |
} | |
return $content; | |
} | |
add_filter('the_excerpt_rss', 'featuredtoRSS'); | |
add_filter('the_content_feed', 'featuredtoRSS'); |
NewerOlder