This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Removing teaser view from a Drupal Node Preview | |
/** | |
* Overrided default preview output by removing teaser view | |
**/ | |
function mytheme_preview($node) { | |
$output = '<div class="preview">'; | |
$output .= node_view($node, 0, FALSE, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DRUSH="$(which drush)" | |
BASEDIR="/var/www/vhosts/mysite.com/httpdocs" | |
cd $BASEDIR | |
#Iterate through sites and put in offline mode | |
ls $BASEDIR/sites |while read line | |
do | |
if [[ "$line" != "all" && "$line" != "default" && "$line" != "CVS" ]] | |
then | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: js/jquery.utils.lite.js | |
=================================================================== | |
--- js/jquery.utils.lite.js (revision 3) | |
+++ js/jquery.utils.lite.js (working copy) | |
@@ -1125,12 +1125,12 @@ | |
*/ | |
$.widget('ui.keynav', { | |
- _init: function(){ | |
+ _create: function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:;jQuery('#colorbox, #cboxOverlay').remove();jQuery('.articleGraf').show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select c.uid, c.cid, c.created | |
from ( | |
select uid, max(created) as maxcreated | |
from comment group by uid | |
) as x inner join comment as c on c.uid = x.uid and c.created = x.maxcreated | |
order by maxcreated desc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reduce = function(key,vals) { | |
return vals.sort(function(a,b){return b - a})[0]; | |
} | |
map = function() { | |
var map_send = function(k,v) { | |
emit(k,v.toString().length); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file My Drush Commands | |
*/ | |
/** | |
* Implementation of hook_drush_help() | |
*/ | |
function my_drush_help($section) { | |
switch ($section) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RobotGuidanceSystem | |
attr_accessor :schematics | |
def initialize(input_file) | |
self.schematics = [] | |
f = File.open(input_file) if File.exists? input_file | |
parse_schematics f.read if f | |
end | |
def run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns document meta description | |
*/ | |
getMetaDescription = function() { | |
var metas = document.getElementsByTagName('meta'); | |
for(var i in metas) { | |
if (typeof(metas[i].name) != 'undefined' && metas[i].name.toLowerCase() == "description") { | |
return encodeURIComponent(metas[i].content); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# A 30 second hack job to compare two CSV files | |
# | |
file1 = ARGV[0] ? ARGV[0] : false | |
file2 = ARGV[1] ? ARGV[1] : false | |
file1_set = [] | |
file2_set = [] | |
delta = [] |
OlderNewer