Skip to content

Instantly share code, notes, and snippets.

View lucprincen's full-sized avatar

Luc Princen lucprincen

View GitHub Profile
flex-flow:column-reverse wrap-reverse;
justify-content:center;
align-content:space-between;
@lucprincen
lucprincen / Flexgrid.scss
Created October 13, 2015 19:54
Simple grid system, dependent on bourbon.io
.column-row{
@include flex-row();
min-height:30px;
.column{
@include flex( 1 );
margin-right:30px;
&:last-of-type{
margin-right:0;
}
## Product configurator
Build entirely in JS. Products + Orders are queried and created using the REST api or
custom ajax-functions. We've used this module on two seperate sites:
* http://www.rondfoto.nl/bestellen/bestelmodule
* http://woodsnap.nl/bestellen/
## Vinden & Verbinden profiles
Profile editting with instant saving and field-validation. Field-groups are created with Advanced Custom Fields,
var _value = 'whatever you want to copy';
$( 'body' ).append("<input type='text' id='temp' style='position:absolute;opacity:0;'>");
$( '#temp' ).val( _value ).select();
document.execCommand( 'copy' );
$( '#temp' ).remove();
/*
* Mixins:
*/
//make flex rows a bit easier:
@mixin flex-row( $equalize:stretch ){
@include display(flex);
@include flex-direction(row);
@include align-items($equalize);
}
.screen-reader-text {
clip: rect(1px, 1px, 1px, 1px);
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
&:focus{
background-color: #f1f1f1;
border-radius: 3px;
$args = array(
'post_type' => 'portfolio',
'posts_per_page' => 6,
'sites' => array(
'sites__not_in' => array( 1 )
),
'orderby' => 'date',
'order' => 'DESC'
);
@lucprincen
lucprincen / gist:18bf4f742b789c39e1b8
Created March 3, 2015 12:50
Woocommerce check weight
add_action( 'woocommerce_add_to_cart', 'check_total_weight' );
function check_total_weight( $itemkey, $product_id, $quantity ){
$product = wc_get_product( $product_id );
$weight = $product->get_weight() * $quantity;
$cart_weight = WC()->cart->cart_contents_weight;
if( $weight + $cart_weight > {TOTAL} ){
@lucprincen
lucprincen / gist:39c5fc3b877cf41cb559
Created December 22, 2014 10:24
Simple placeholder fallback for gravity forms
var inputs = {};
jQuery('.gfield input, .gfield textarea' ).each( function(){
var _id = jQuery( this ).attr('id');
var _string = jQuery( this ).val();
inputs[_id] = _string;
#!/bin/sh
cd ../your/staging/location
echo -e "\033[32m Downloading WordPress... "
echo -e "\033[0m"
printf "De url van deze site is: your/staging/location/..."
read NEWDIR
mkdir $NEWDIR