Skip to content

Instantly share code, notes, and snippets.

View norcross's full-sized avatar
somone said this would be easy. someone LIED.

Norcross norcross

somone said this would be easy. someone LIED.
View GitHub Profile
@unruthless
unruthless / CSS for <sup> and <sub>
Created May 26, 2010 01:31
CSS for <sub> and <sup>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
# Copyright 2010 Drew Blas <drew.blas@gmail.com>
# From: http://drewblas.com/2010/07/15/an-analysis-of-gpled-code-in-thesis
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@chriscoyier
chriscoyier / gist:945619
Created April 28, 2011 01:33
commentgraph.php
<?php
/*
Template Name: Comment Graph
*/
?>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
@chriscoyier
chriscoyier / gist:972699
Created May 14, 2011 22:20
commentcodeplugin.md

IDEA: WordPress Plugin for Improving Leaving Code in Comments

It's always quite a struggle to keep people doing it correctly on CSS-Tricks, so I'd love if there was a plugin to make it more foolproof.

The overall idea: make it so if you use <code> tags, it will come out perfectly.


1) Automatically escape code that isn't escaped

@billerickson
billerickson / gist:1204283
Created September 8, 2011 18:50
Limit metabox to specific page
<?php
// Changes to metabox array, new field 'show_on'
$meta_boxes[] = array(
'id' => 'blog-options',
'title' => 'Blog Options',
'pages' => array('page'),
'show_on' => array( 'key' => 'id', 'value' => array( 12 ) ),
'context' => 'normal',
'priority' => 'low',
@jonathonbyrdziak
jonathonbyrdziak / CustomWidgetFile.php
Last active September 29, 2022 22:00
EMPTY WIDGET Plugin code to create a single widget in wordpress.
<?php
/**
* Duplicate this file as many times as you would like, just be sure to change the
* Empty_Widget class name to a custom name of your choice. Have fun! redrokk.com
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Contact_RedRokk_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com
@helen
helen / repeatable-fields-metabox.php
Created January 11, 2012 04:42
Repeating Custom Fields in a Metabox
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
@jkudish
jkudish / always-login.php
Created January 13, 2012 21:08
Always logged in with WordPress
<?php
/**
* keeps a user always logged in
* don't use this on a production site, ever!
*/
add_action('init', 'auto_login');
add_action('admin_init', 'auto_login');
function auto_login() {
<?php
add_action( 'genesis_before_loop', 'be_recipe_archive_intro', 15 );
/**
* Intro - Recipe Archive
* @author Bill Erickson
*
* (in archive-recipes.php)
*/
function be_recipe_archive_intro() {