Skip to content

Instantly share code, notes, and snippets.

View tomhermans's full-sized avatar
👻
tinkering

Tom Hermans tomhermans

👻
tinkering
View GitHub Profile
@vxnick
vxnick / gist:380904
Created April 27, 2010 15:52
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
@vasilisvg
vasilisvg / HTML-presentation-tools.md
Created January 14, 2012 13:53
HTML presentation tools

#HTML presentation tools

There are many HTML presentation tools and they are all created for slightly different reasons. Here's an overview. Please let me know if I forgot any.

##CSSS

CSS-based SlideShow System

@BronsonQuick
BronsonQuick / populate_gravity_forms_pre_submission.php
Created May 30, 2012 06:39
Populate a hidden field in Gravity Forms before submission
<?php
/* gform_pre_submission will do all forms. gform_pre_submission_1 will do a form with an ID of 1
* Keep an eye on the priority of the filter. In this case I used 9 because the Salesforce plugin we used ran a presubmission filter at 10 so we needed this to happen before it
*/
add_filter( "gform_pre_submission_1", "add_salesforce_campaign_id_footer", 9 );
function add_salesforce_campaign_id_footer( $form ){
foreach($form["fields"] as &$field)
if($field["id"] == 2){
/* Set the variable you want here - in some cases you might need a switch based on the page ID.
* $page_id = get_the_ID();
@jeffsebring
jeffsebring / _wordpress.sass
Created October 29, 2012 16:21
WordPress Core Styles SASS
.sticky,
.bypostauthor,
.gallery-caption
display: normal
.alignright
float: right
display: block
.alignleft
@davidmerrique
davidmerrique / zoomify.jsx
Last active April 14, 2017 06:17
Photoshop Script to save multiple sizes of an image. I use it for work.
var inFolder = Folder.selectDialog("Please select folder to process");
if(inFolder !== null) {
var fileList = inFolder.getFiles(/\.(jpg|tif|psd|)$/i);
var outfolderName = prompt('Folder name', 'zoom');
var outfolder = new Folder(decodeURI(inFolder) + "/" + outfolderName);
if (!outfolder.exists) outfolder.create();
for(var a = 0; a < fileList.length; a++) {
@hatefulcrawdad
hatefulcrawdad / foundation5-grid.css
Created June 18, 2013 17:31
Sneak peek at what we're thinking about for the Foundation 5 Grid.
/* Row and Column defaults */
.row { margin-left: auto; margin-right: auto; margin-top: 0; margin-bottom: 0; max-width: 62.5em; width: 100%; }
.row .row.collapse { margin-left: 0; margin-right: 0; max-width: none; width: auto; }
.row .row { margin-left: -0.9375em; margin-right: -0.9375em; max-width: none; width: auto; }
.row.collapse .column, .row.collapse .columns { padding-left: 0; padding-right: 0; float: left; }
.column, .columns { padding-left: 0.9375em; padding-right: 0.9375em; width: 100%; float: left; position: relative; }
/* Up to 640px */
@media only screen {
.small-1 { width: 8.33333% }
@hofmannsven
hofmannsven / README.md
Last active November 18, 2020 12:11
How to create SVGs with layers for the web.
@nciske
nciske / clean_post_content.php
Last active January 4, 2016 07:59
Cleanup WP post content (e.g. after a migration from another CMS)
<?php
// Warning: this will overwrite every post in your database
// BACKUP FIRST!
clean_post_content();
function clean_post_content() {
$posts = get_posts(array(
'post_type' => array('post'), // or page, or cpt
'post_status' => 'publish', // or any, draft, etc
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@Gaya
Gaya / responsive-svg-sprite-template.scss
Last active September 15, 2017 14:19
Responsive SVG Sprite Mixin
/*
* Generate a SVG-sprite mixin for Sass
* ====================================
*
* Gaya Kessler - http://gaya.ninja - http://twitter.com/GayaNinja
*
* SVGSprite is a wonderful package, but doesn't enable responsive sprites out of the box.
* This moustache template generates a sass file with a mixin for the generated SVG-sprite.
* Calculates the position and size of the background by filename.
* Included SVG image scales to width and height.