Skip to content

Instantly share code, notes, and snippets.

View jacmaes's full-sized avatar

Jacques Maes jacmaes

View GitHub Profile
@jacmaes
jacmaes / mediaquerycolums.html
Created January 31, 2012 22:51 — forked from adactio/mediaquerycolums.html
Multiple columns dependent on media queries that test for height as well as width.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Media Query Multiple Columns</title>
<meta name="viewport" content="width=device-width, intial-scale=1">
<style>
@media all and (min-width: 40em) and (min-height: 36em) {
[role="main"] {
-webkit-column-count: 2;
@jacmaes
jacmaes / gist:5615332
Last active December 17, 2015 13:10 — forked from toddmotto/gist:5595174
Detect SVG support and add HTML class. By Todd Motto.
!function(){
function supportsSVG() { return !! document.createElementNS && !! document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect }
if (supportsSVG()) document.documentElement.className += ' svg'
else document.documentElement.className += ' no-svg'
}()
<?php
// front-end form example with multiple images upload
// add new page created on the fly and adding images
$message = '';
if($input->post->submit){
// tmp upload folder for additional security
<?php
$out = '';
// create a new form field (also field wrapper)
$form = $modules->get("InputfieldForm");
$form->action = "./";
$form->method = "post";
$form->attr("id+name",'subscribe-form');
@jacmaes
jacmaes / form.php
Last active July 12, 2023 07:58 — forked from somatonic/inputfieldfile-form.php
Processwire: Front-end upload form example using ProcessWire Inputfields #pw
<?php
/**
* Front-end upload form example
* using ProcessWire Inputfields
*/
$sent = false;
$upload_path = $config->paths->assets . "files/.tmp_uploads/";
/*
From Marty Walker Pastie
Picturefill markup with ProcessWire image sizing
https://github.com/scottjehl/picturefill/
http://processwire.com/
*/
<div data-picture data-alt='{$page->title}'>
<div data-src='{$image->size(50,0)->url}'></div>
<?php
// ------------------------------ FORM Processing ---------------------------------------
$errors = null;
$success = false;
// helper function to format form errors
function showError($e){
return "<p class='error'>$e</p>";
<?php
/**
* Front-end upload form example
* using ProcessWire Inputfields
*/
$sent = false;
$upload_path = $config->paths->assets . "files/.tmp_uploads/";
// http://processwire.com/talk/topic/1938-building-an-advanced-search-form-with-form-builder/?p=36295
<form name='search' id='product-search' method='get' action='<?php echo $config->urls->root?>speaker-finder/'>
<ul id="row1">
<li>
<label for='search_app'>Application</label>
<select id='search_app' name='application' onchange="$(this.form).trigger('submit')">
<option value=''>Any</option><?php
// generate the application options, checking the whitelist to see if any are already selected
@jacmaes
jacmaes / search-processor.php
Last active December 6, 2018 14:56 — forked from outflux3/search-processor.php
Search #pw
<?php
// http://processwire.com/talk/topic/1938-building-an-advanced-search-form-with-form-builder/?p=36295
// check if there are GET variables present in the URL
if(count($input->get)) {
$selector = '';
if($input->get->application) {