Skip to content

Instantly share code, notes, and snippets.

View micahredding's full-sized avatar

Micah Redding micahredding

View GitHub Profile
@dominictarr
dominictarr / CYPHERLINK.md
Last active April 24, 2024 16:17
Cypherlinks
@ewillhite
ewillhite / popup.js
Created June 10, 2013 16:33
Lightbox AJAX javascript
// Open in Lightbox when clicked
Drupal.behaviors.popupLink = function (context) {
$('LINK').click(function() {
var url = $(this).attr('href') + ' .node .content';
$('#overlay, .popup').remove();
$('<div id="overlay"></div>').appendTo('body').css('opacity','0').show().animate({opacity:.5});
$('<div class="popup"></div>').appendTo('body');
$('.popup').load(url, function() {
var topCenter = ($(window).height() - $('.popup').outerHeight()) / 2;
@ewillhite
ewillhite / popup.css
Created June 10, 2013 16:32
Lightbox popup
/*------------------------------------------------------------
Lightbox Stuff (replace POPUPBLOCK with name of pop-up div)
-----------------------------------------------------------*/
#overlay {
background-color: #E0E1DC;
display: none;
height: 100%;
width: 100%;
position: fixed;
top: 0;
@bval
bval / .htrouter.php
Created February 19, 2013 21:33
This is a router for Drupal and other PHP apps that rely on mod_rewrite rules for "clean URLs" so that those same apps can be run under PHP 5.4's built-in webserver which doesn't support mod_rewrite.
<?php
/**
* @file
* The router.php for clean-urls when use PHP 5.4.0 built in webserver.
*
* Usage:
*
* php -S localhost:3000 .htrouter.php
*
*/
@lsolesen
lsolesen / template.php
Created June 24, 2011 18:58
Change tabs to contextual links in Drupal 7
/**
* Implements hook_menu_local_task()
*
* @param array $variables
*
* return string with html
*/
function mytheme_menu_local_task($variables) {
$link = $variables['element']['#link'];
// remove the view link when viewing the node