Skip to content

Instantly share code, notes, and snippets.

View inlikealion's full-sized avatar

Matt Bainton inlikealion

View GitHub Profile
@inlikealion
inlikealion / Drupal 6 Body Classes
Created January 21, 2011 23:13
Body classes for almost everything in Drupal 6
<?php
function phptemplate_preprocess_page(&$vars, $hook) {
// Classes for body element. Allows advanced theming based on context
// (home page, node of certain type, etc.)
$body_classes = array($vars['body_classes']);
if (!$vars['is_front']) {
// Add unique classes for each page and website section
$path = drupal_get_path_alias($_GET['q']);
list($section, ) = explode('/', $path, 2);
@inlikealion
inlikealion / Drupal: System Customization - Company Info
Created February 21, 2011 21:09
Module creates simple custom form page for extended company contact info + social media, etc…
<?php
// $Id:
function system_custom_menu() {
$items = array();
$items['admin/settings/site-additional-info'] = array(
'title' => t('Additional Site Information'),
@inlikealion
inlikealion / CSS Setup Comments
Created March 30, 2011 15:25
Basic setup of main css file, with example sectioning, etc…
/* _________________________________________________
For:
Original Author:
URL:
Thanks to: Ethan Marcotte, HTML5BoilorPlate.com & 320andUp
____________________________________________________
`GLOSSARY`:
@inlikealion
inlikealion / Dummy Text
Created April 7, 2011 13:53
Dummy text provided by Matthew Smith of Squared Eye
This is dummy copy. It is not meant to be read. It has been placed here solely to demonstrate the look and feel of finished, typeset text. Only for show. He who searches for meaning here will be sorely disappointed. These words are here to provide the reader with a basic impression of how actual text will appear in its final presentation. Think of them merely as actors on a paper stage, in a performance devoid of content yet rich in form. That being the case, there is really no point in your continuing to read them. After all, you have many other things you should be doing. Who's paying you to waste this time, anyway?
This is dummy copy. It's Greek to you. Unless, of course, you're Greek, in which case, it really makes no sense. Why, you can't even read it! It is strictly for mock-ups. You may mock it up as strictly as you wish.
Meaningless mock-up, mock turtle soup spilled on a mock turtle neck. Mach I Convertible copy. To kill a mockingbird, you need only force it to read this copy. This is Meaningless
@inlikealion
inlikealion / hg-merge-branch.txt
Created April 26, 2011 22:21
Checklist of commands for Mercurial merge branches & push to remote repo
hg in/pull // Check for updates from other devs
hg update <branch-name-to-merge-to> // Likely 'default' branch
hg merge <my-dev-branch> // Where changes are coming from
hg commit
hg in/pull
hg push
hg update <my-dev-branch> // Go back to my branch to keep working
@inlikealion
inlikealion / windowshosts.txt
Created June 13, 2011 15:23
Windows hosts file location
c:\windows\system32\drivers\etc\hosts
@inlikealion
inlikealion / .bash_profile
Created June 20, 2011 13:37 — forked from rickharris/.bash_profile
Two-line bash prompt
PS1='\r\n\[\033[0;35m\]\u@\H\[\033[0m\] in \[\033[34m\]\w\[\033[37m\]\r\n∴ \[\033[0m\]'
@inlikealion
inlikealion / tabs.js
Created July 6, 2011 20:52
Simply tabs.
$(function() {
// Functionality:
// ID tabs like this:
// [TAB_PREFIX][name_1]
// [TAB_PREFIX][name_2]
// [TAB_PREFIX][name_3]
// ID tab content like this:
// [CONTENT_PREFIX][name_1]
// [CONTENT_PREFIX][name_2]
// [CONTENT_PREFIX][name_3]
.hide-text {
overflow: hidden;
text-indent: 100%;
white-space: nowrap;
}
@inlikealion
inlikealion / g.pie.js
Created June 6, 2012 20:04
g.Raphael example from @kyle
Raphael.fn.pieChart = function (cx, cy, r, rin, values, options) {
var paper = this,
rad = Math.PI / 180,
colors = options.colors
chart = this.set();
function sector(cx, cy, r, startAngle, endAngle, params) {
var x1 = cx + (r) * Math.cos(-startAngle * rad),
x2 = cx + (r) * Math.cos(-endAngle * rad),
y1 = cy + (r) * Math.sin(-startAngle * rad),