Skip to content

Instantly share code, notes, and snippets.

View Zenger's full-sized avatar
⌨️
=

Dennis Zenger Zenger

⌨️
=
View GitHub Profile
@Zenger
Zenger / webfonts.php
Last active October 13, 2015 23:48
A big array of google web fonts
<?php
/*
*
* Google Web Fonts PHP list
* This file has a list of all Google Web Fonts
* Note that it may not be up to date
*
*/
$google_web_fonts = array(array('ABeeZee', 'regular,italic,'),array('Abel', 'regular,'),array('Abril Fatface', 'regular,'),array('Aclonica', 'regular,'),array('Acme', 'regular,'),array('Actor', 'regular,'),array('Adamina', 'regular,'),array('Advent Pro', '100,200,300,regular,500,600,700,'),array('Aguafina Script', 'regular,'),array('Akronim', 'regular,'),array('Aladin', 'regular,'),array('Aldrich', 'regular,'),array('Alegreya', 'regular,italic,700,700italic,900,900italic,'),array('Alegreya SC', 'regular,italic,700,700italic,900,900italic,'),array('Alex Brush', 'regular,'),array('Alfa Slab One', 'regular,'),array('Alice', 'regular,'),array('Alike', 'regular,'),array('Alike Angular', 'regular,'),array('Allan', 'regular,700,'),array('Allerta', 'regular,'),array('Allerta Stencil', 'regular,'),array('Allura', 'regular,'),array('Almendra', 'regular,italic,700,700italic,'),array('Al
@Zenger
Zenger / gist:3175074
Created July 25, 2012 08:22
Snippets
<?php
// checks file mime type, if it's a image.
if ( stristr($mime, "image/") === false)) return false;
?>
@Zenger
Zenger / gist:2988446
Created June 25, 2012 13:01
Wordpress select and order by a meta_value
<?php
$wQuery = new WP_Query(
array('post_type' => 'post',
'posts_per_page' => $how_many,
'cat' => '46,43', // categories should be supplied this way (an array doesn't work)
'meta_key' => 'post_views' ,
'orderby' => 'meta_value_num', // or meta_value (if it's a string)
'order' => 'DESC')
);
@Zenger
Zenger / Javascript
Created June 9, 2012 07:04
Javascript/PHP numbers Only
/* Without jQuery */
/* Example
<input id="myInput" name='credit-card' value='' />
*/
document.getElementById('myInput').onkeyup = function() {
this.value = this.value.replace(/[^\d]/gi , '');
};