Skip to content

Instantly share code, notes, and snippets.

View greylabel's full-sized avatar

Grant Gaudet greylabel

View GitHub Profile
@scottjehl
scottjehl / anchorinclude.js
Created May 20, 2011 17:04
Anchor-include Pattern
/*
* anchor-include pattern for already-functional links that work as a client-side include
* Copyright 2011, Scott Jehl, scottjehl.com
* Dual licensed under the MIT
* Idea from Scott Gonzalez
* to use, place attributes on an already-functional anchor pointing to content
* that should either replace, or insert before or after that anchor
* after the page has loaded
* Replace: <a href="..." data-replace="articles/latest/fragment">Latest Articles</a>
* Before: <a href="..." data-before="articles/latest/fragment">Latest Articles</a>
@mattfarina
mattfarina / custom.module
Created December 27, 2011 16:05
Protocol Relative URLs in Drupal 7
<?php
/**
* Implements hook_file_url_alter().
*
* Make all URLs be protocol relative.
* Note: protocol relatice URLs will cause IE7/8 to download stylesheets twice.
* @see http://www.stevesouders.com/blog/2010/02/10/5a-missing-schema-double-download/
*/
function custom_file_url_alter(&$url) {
@saetia
saetia / gist:1623487
Last active July 16, 2024 05:56
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@mehlah
mehlah / Consumer.php
Created April 6, 2012 11:32
Auth Oauth adapter Lithium
<?php
namespace li3_omniauth;
class Consumer extends \lithium\core\StaticObject {
/**
* Holds an instance of the oauth service class
*
* @see \li3_oauth\extensions\services\Oauth
@simX
simX / hidpi.txt
Created July 28, 2012 04:58
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.
@kenwoodworth
kenwoodworth / BlendedButtons.scss
Created August 22, 2012 12:25
An example of a button style that adapts to a base color using the overlay blend-mode to adjust colors for effects.
$button-color: #ff6600;
%button-base {
@include adjust-font-size-to(14px, 1.5);
@include inline-block;
@include border-radius(6px);
font-weight: bold;
padding: 3px 30px;
position: relative;
text-decoration: none;
@eaton
eaton / gist:3768758
Created September 23, 2012 03:40 — forked from saetia/gist:1623487
Clean Install – Mountain Lion OS X 10.8
@webbj74
webbj74 / CHEATSHEET.md
Created September 26, 2012 14:54
Generic Git Cheatsheet

Git Cheatsheet

Add an upstream remote repo

git remote add <name> <url>
git remote add upstream git@github.com:central-github-repo-username/sitename.git
@jacine
jacine / retina.md
Created October 17, 2012 18:36
Automated Retina Sprites with Compass

Automated Retina Sprites with Compass

I asked the following on Twitter the other day:

Thoughts, anyone? "Seems like there are a million ways to do retina sprites with Compass. What's the best way? #sass #compass" tweet

Specifically, what I wanted to do was to reference an icon once, like so:

.selector {
  @include the-sprite('once');
@becw
becw / example.install.php
Last active March 26, 2019 06:53
Enable/revert a feature in a Drupal update hook #drupal7
/**
* EXAMPLE FEATURE UPDATE
* Enable and revert the my_new_feature_name feature.
*/
function example_update_7001() {
// An array of new or changed features; the array keys are feature names,
// values are an array of exportable types as seen in a feature's .info file:
// features[field][] = node-page-body
$features = array(
'my_new_feature_name' => array('field', 'variable'),