This file contains hidden or 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
diff --git a/field_collection.module b/field_collection.module | |
index 9da8350..6610fa6 100644 | |
--- a/field_collection.module | |
+++ b/field_collection.module | |
@@ -1142,3 +1142,87 @@ function field_collection_devel_generate($object, $field, $instance, $bundle) { | |
return array('value' => $field_collection->item_id); | |
} | |
+ | |
+/** |
This file contains hidden or 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 | |
//From http://code.seebz.net/p/autolink-php/ | |
//Convert plain text URLs into clickable links | |
function autolink($str, $attributes=array()) { | |
$attrs = ''; | |
foreach ($attributes as $attribute => $value) { | |
$attrs .= " {$attribute}=\"{$value}\""; | |
} | |
This file contains hidden or 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
/** | |
* Protect window.console method calls, e.g. console is not defined on IE | |
* unless dev tools are open, and IE doesn't define console.debug | |
* Source: http://stackoverflow.com/questions/3326650/console-is-undefined-error-for-internet-explorer | |
*/ | |
(function() { | |
if (!window.console) { | |
window.console = {}; | |
} | |
// union of Chrome, FF, IE, and Safari console methods |
This file contains hidden or 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 | |
function win_time($timestr) { | |
return substr($timestr, 4, 2) . "/" . substr($timestr, 6, 2) . "/" . | |
substr($timestr, 0, 4) . " " . substr($timestr, 8, 2) . ":" . | |
substr($timestr, 10, 2) . ":" . substr($timestr, 12, 2) . " " . | |
substr($timestr, -4); | |
}; | |
?> |
This file contains hidden or 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
-- main.scpt | |
-- Cocoa-AppleScript Applet | |
tell application "Terminal" | |
activate | |
do shell script "/usr/local/bin/wine '/Users/<user>/.wine/drive_c/Program Files/<programdir>/<program.exe>'" | |
end tell |
This file contains hidden or 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 | |
// Enter node NID to export. | |
$nid = 1234; | |
// Use Drupal's export utility to convert the object to code. | |
include_once DRUPAL_ROOT . '/includes/utility.inc'; | |
$export = drupal_var_export(node_load($nid)); | |
// Strip node NIDs and VIDs, so it imports cleanly. |
This file contains hidden or 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
//adapted from http://stackoverflow.com/questions/6001839/check-whether-a-url-variable-is-set-using-jquery | |
//modified to return empty array when no ? params are set | |
$.extend({ | |
getUrlVars: function(){ //return all vars set in $_GET | |
var vars = [], hash; | |
if (window.location.href.indexOf('?') != -1) { | |
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); | |
for(var i = 0; i < hashes.length; i++) | |
{ | |
hash = hashes[i].split('='); |
This file contains hidden or 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
#Separates columns in a CSV into individual files with unique values per field | |
# Useful for generating lookup tables with unique values from the original csv's field | |
# | |
# Room for implementation improvement, but this works as a quick and dirty solution | |
#!/usr/bin/python | |
import csv | |
from distutils.util import strtobool |
This file contains hidden or 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
# Originally from http://www.adminarsenal.com/admin-arsenal-blog/powershell-silently-change-firefox-default-search-providers-for-us | |
$Provider = "Google" | |
# Default valid provider options: | |
# Amazon.com, Bing, DuckDuckGo, eBay, Google, Twitter, Wikipedia (en), Yahoo | |
# This disclaimer is required verbatim... | |
$Disclaimer = "By modifying this file, I agree that I am doing so only " | |
$Disclaimer += "within Firefox itself, using official, user-driven search " | |
$Disclaimer += "engine selection processes, and in a way which does not " |
OlderNewer