Skip to content

Instantly share code, notes, and snippets.

View simonkberg's full-sized avatar
:shipit:

Simon Kjellberg simonkberg

:shipit:
View GitHub Profile
@simonkberg
simonkberg / grid.html
Created July 30, 2012 15:49
CSS-grid Generator
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>CSS-grid Generator</title>
<meta name="description" content="The easiest way to construct a basic CSS-grid layout. With query-strings!" />
<meta name="author" content="SimonKberg" />
<meta name="viewport" content="width=device-width; initial-scale=1.0" />
@simonkberg
simonkberg / LICENSE.txt
Created June 13, 2011 12:30 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@simonkberg
simonkberg / OS-Browser_classes.php
Created August 7, 2010 11:58
This PHP function detects which Browser (+version) and OS a user is running and returns or print it in a class-friendly format to use in e.g. Body-class
<?php
//
// This PHP function detects which Browser (+version) and OS a user is running and returns or
// print it in a class-friendly format to use in e.g. Body-class
//
// Use like <?php echo "<body class=\"".OSbodyClass(false)."\">"; ?>
// or <body class="<?php OSbodyClass(); ?>">
//
// example output for Firefox 3.6.8 running on Windows 7: <body class="windows firefox ff3">
_gaq.push(['_trackEvent', thisel.parents('[id!=""]:first').get(0).id, 'clicked', (thisel.text() || thisel.children('img:first').attr('alt'))]);
<?php
/* Place in /wp-content/ */
include('../wp-config.php');
include('../wp-load.php');
global $wpdb;
//Settings
$type = 0; //1 for post, everything else for pages
$category_id = 1; // ID of the category, or...