Skip to content

Instantly share code, notes, and snippets.

@z3cka
z3cka / index.html
Created September 21, 2012 05:09
fbf2
index.html coming
@z3cka
z3cka / yourawesomemodule.module
Created October 15, 2012 23:24
remove so and so's blog link from the blog links
/**
* Implements hook_node_view_alter().
*/
function yourawesomemodule_node_view_alter(&$build){
// remove so and so's blog link from the blog links
if ($build['links']['blog']) {
$build['links']['blog'] = NULL;
}
}
@z3cka
z3cka / template.php
Created October 19, 2012 05:21
page preprocess var for login/logout
function ninsixty_spw_preprocess_page(&$vars) {
global $user;
if ($user->uid != 0) {
// code for the logout button
$vars['loginout'] = "<a href=\"/user/logout\">Log out</a>";
} else { $vars['loginout'] = NULL; }
}
@z3cka
z3cka / gist:3988438
Created October 31, 2012 17:19
example of current views row markup
<div class="views-slideshow-cycle-main-frame-row-item views-row views-row-0 views-row-first views-row-odd">
<span class="views-field views-field-field-image">
<span class="field-content"><img typeof="foaf:Image" src="http://victoryfoam.sey.gr/sites/default/files/styles/medium/public/victory-foam-specialty-tool-case-4.jpg" width="192" height="220" alt="">
</span>
</span>
<div id="title-body-wrapper">
<span class="views-field views-field-title">
<h2 class="field-content"><a href="/node/8">Tool Control</a></h2>
</span>
<div class="views-field views-field-body">
@z3cka
z3cka / pmtc.js
Created November 9, 2012 23:28
a poormans tag cloud built from drupal views rows
(function($){
$(document).ready(function(){
// build an awesome tag cloud
function rowobject(param1, param2){
this.name=param1;
this.countresult=param2;
}
// create array that will be filled with objects
var rows = Array();
// grab a tag count for each tag
@z3cka
z3cka / menu.html
Created November 13, 2012 23:31
sample menu - with new div
<div class="new-wrapper">
<div id="nav-masthead" class="grid-12">
<ul>
<li class="homepage first"><a href="/home">Drupal Homepage</a></li>
<li class="login-register last"><a href="/user?destination=node%2F918708">Log in / Register</a></li>
</ul>
</div>
</div>
@z3cka
z3cka / gist:4156214
Created November 27, 2012 18:51
server-status
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
## Allow from localhost
# Allow from 131.216.134.76
Allow from all
</Location>
@z3cka
z3cka / image-link-overlay.css
Last active December 15, 2015 09:58
image link overlay hack. this will place an image over another image that is within an anchor tag.
@z3cka
z3cka / isu.sh
Last active December 18, 2015 11:38
A silly little bash script for checking if a site is up. usage: ./isu.sh sitetocheck.com
#!/bin/sh
siteResponse=`curl -s -I $1 | grep HTTP/1.1 | awk {'print $2'}`
if [ $siteResponse = 200 ]; then
echo "Looks like your site responded with a" $siteResponse "and is fine, be happy!"
else
echo "rut ro! Looks like your site responded with a" $siteResponse "and that's not right, go fix it!"
case $siteResponse in
301 )
@z3cka
z3cka / gist:5988292
Last active December 19, 2015 16:59 — forked from crifkin/gist:5986419
NOTE: version numbers are at the time of this writing
1. Download and install Virtualbox (4.2.16)
2. Download and install Vagrant (1.2.3)
3. Check ruby and rubygems versions
4. Install berkshelf gem
gem install berkshelf --version '>= 1.4.0' --no-ri --no-rdoc
5. Install berkshelf vagrant plugin
vagrant plugin install vagrant-berkshelf --plugin-version '1.2.0'
6. Add vagrant basebox provided in Crifkin Training package (precise64_chef11.box)