Skip to content

Instantly share code, notes, and snippets.

View chimericdream's full-sized avatar

Bill Parrott chimericdream

View GitHub Profile
@chimericdream
chimericdream / asshole.js
Created May 24, 2011 15:25 — forked from Kilian/annoying.js
How to be an asshole
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Licensed under the MIT license. http://www.opensource.org/licenses/mit-license.php
*
*/
@chimericdream
chimericdream / css-responsive-images-alt.html
Created January 15, 2012 22:07 — forked from barbietunnie/css-responsive-images-alt.html
Idea for CSS-only responsive images using CSS3 generated content and attr() function. No browser implementation as of May 2011
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS responsive images</title>
<style>
/* Play nice with existing requirements for
Responsive Images polyfill */
@media (min-device-width:600px) {
@chimericdream
chimericdream / LICENSE.txt
Created February 2, 2012 14:43 — forked from aemkei/LICENSE.txt
Binary Tetris - 140byt.es
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
@chimericdream
chimericdream / ms.js
Created February 11, 2012 05:23 — forked from rauchg/ms.md
Milliseconds conversion utility.
/**
# ms.js
No more painful `setTimeout(fn, 60 * 4 * 3 * 2 * 1 * Infinity * NaN * '☃')`.
ms('2d') // 172800000
ms('1.5h') // 5400000
ms('1h') // 3600000
ms('1m') // 60000
@chimericdream
chimericdream / style.css
Created March 15, 2012 22:22 — forked from luetkemj/style.css
WP-CSS: Wordpress classes
/* =============================================================================
WordPress WYSIWYG Editor Styles
========================================================================== */
.entry-content img {
margin: 0 0 1.5em 0;
max-width: 100%;
height: auto;
}
.alignleft, img.alignleft {
@chimericdream
chimericdream / gist:2052894
Created March 16, 2012 21:38 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@chimericdream
chimericdream / mirror-github.sh
Created May 30, 2012 19:23 — forked from infertux/mirror-github.sh
A little Bash script to make a mirror of your Github repositories and keep them up-to-date.
#!/bin/bash
# A little Bash script to make a mirror of your Github repositories and keep
# them up-to-date.
# Why mirroring? Because I can!
# Also, it will be very useful if one day a meteorite crashes into Github
# servers (even if it will not happen).
# https://gist.github.com/950441
@chimericdream
chimericdream / gist:2838419
Created May 30, 2012 19:24 — forked from AaronSeibert/gist:1565820
Bash function for creating a new project and automatically creating a new repo on github
function newproject {
username=""
apikey=""
apiurl="http://github.com/api/v2/"
apiformat="json"
name=$@
# Create the repo on github
curl -F "login=${username}" -F "token=${apikey}" $apiurl$apiformat/repos/create -F "name=${name}"
@chimericdream
chimericdream / pnginator.rb
Created August 6, 2012 21:18 — forked from gasman/pnginator.rb
pnginator: pack Javascript into a self-extracting PNG
#!/usr/bin/env ruby -w
# pnginator.rb: pack a .js file into a PNG image with an HTML payload;
# when saved with an .html extension and opened in a browser, the HTML extracts and executes
# the javascript.
# Usage: ruby pnginator.rb input.js output.png.html
# By Gasman <http://matt.west.co.tt/>
# from an original idea by Daeken: http://daeken.com/superpacking-js-demos
@chimericdream
chimericdream / is_blog.php
Created August 24, 2012 05:16 — forked from wesbos/is_blog.php
WordPress is_blog()
function is_blog () {
global $post;
$posttype = get_post_type($post );
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ;
}
Usage:
<?php if (is_blog()) { echo 'You are on a blog page'; } ?>