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
require 'digest/md5' | |
def gfm(text) | |
# Extract pre blocks | |
extractions = {} | |
text.gsub!(%r{<pre>.*?</pre>}m) do |match| | |
md5 = Digest::MD5.hexdigest(match) | |
extractions[md5] = match | |
"{gfm-extraction-#{md5}}" | |
end |
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
/* | |
Remove inline style="..." | |
Preserve hidden content. | |
Call the function like this: | |
var all = document.getElementsByTagName('*'); | |
remove_style(all); |
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
// JS Module Pattern: | |
// http://j.mp/module-pattern | |
// Redefine: $, window, document, undefined. | |
var APP = (function($, window, document, undefined) { | |
// Automatically calls all functions in APP.init | |
$(document).ready(function() { | |
APP.go(); | |
}); |
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
type "mysql" when logged in as root via SSH and then paste this: | |
UPDATE `database`.`files` SET filepath = REPLACE(filepath, 'sites/olddomain.com/', 'sites/newdomain.com/'); | |
UPDATE `database`.`node_revisions` SET body = REPLACE(body, 'sites/olddomain.com/', 'sites/newdomain.com/'); | |
UPDATE `database`.`boxes` SET body = REPLACE(body, 'sites/olddomain.com/', 'sites/newdomain.com/'); | |
NOTE: "database" should be replaced with your site's database name from settings.php created by Aegir. | |
"olddomain.com" and "newdomain.com" should be replaced with existing and expected (sub)domain. |
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
/* | |
Read more here: | |
https://developer.mozilla.org/en/CSS/@-moz-document | |
For more browser-specific hacks: | |
http://paulirish.com/2009/browser-specific-css-hacks | |
*/ | |
@-moz-document url-prefix() { | |
/* Put your Firefox specific code here. */ |
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
# Put this in your .gitconfig | |
[url "http://git.drupal.org/project/"] | |
insteadOf = "do:" |
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
// Paste into Firebug or Chrome Dev Tools console | |
// when viewing a page with multiple checkboxes. | |
(function(d) { | |
var input = d.querySelectorAll('input[type="checkbox"]'); | |
var i = input.length; | |
while (i--) { | |
input[i].checked = true; | |
} |
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
.background_clip | |
// Seriously, why isn't this just the | |
// freakin' default in all browsers? | |
+background-clip(padding-box) | |
// Not sure what this does? Have a looksie... | |
// http://compass-style.org/examples/compass/css3/background-clip | |
// Crucial, if you have rounded corners on something with | |
// both background color and a border. Without, background |
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
easterEgg.BadWorder.list={ | |
"4r5e":1, | |
"5h1t":1, | |
"5hit":1, | |
a55:1, | |
anal:1, | |
anus:1, | |
ar5e:1, | |
arrse:1, | |
arse:1, |
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 | |
$options['shell-aliases'] = array( | |
'ccall' => '!drush cc all && growlnotify -t "Drush" -m "cc all done!"' | |
); |
OlderNewer