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 | |
/** | |
* @file Node Export i18n module | |
*/ | |
// Ensure this node type has multilingual support | |
/** |
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 custom_import_import_files_batch_files(&$context) { | |
db_set_active('import'); | |
// Build the total import count. | |
// need to query D5 db | |
// mysql> select nr.body from node_revisions nr join node n on n.nid = nr.nid where n.type = 'homepage' and nr.body like '%flipperpage%'; | |
if (empty($context['sandbox'])) { |
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
# Quick snippet to convert public key signatures from an authorized_keys file into their ssh fingerprint | |
# Usage: python fingerprint_conversion.py authorized_keys | |
import base64,hashlib,sys | |
line = sys.argv[1] | |
f = open(line, 'r') | |
for key in f: | |
key = str(key.strip().split()[1]) |
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
#!/usr/bin/ruby | |
#require "net/http" | |
require "net/https" | |
require "uri" | |
require "socket" | |
require "yaml" | |
$redirects = Array.new |
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
#!/bin/bash | |
if [ -z "${1}" ] ; | |
then | |
echo 'Please enter the address the TTL should be found for' | |
exit 1 | |
fi | |
NS=`host -t NS $1 | awk {'print $4'}` | |
arr=$(echo $NS | tr " " "\n") | |
for x in $arr |
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 | |
$emails = array( | |
// fill in emails here or use array from somewhere else | |
); | |
foreach ($emails as $mail) { | |
$query = "SELECT 1 FROM {users} WHERE mail = :mail"; | |
$exists = db_query_range($query, 0, 1, array(':mail' => $mail))->fetchField(); |
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/src/commands.c b/src/commands.c | |
index 411f944..7af604f 100644 | |
--- a/src/commands.c | |
+++ b/src/commands.c | |
@@ -480,6 +480,23 @@ void chat(char *buf, struct user_t *user) | |
logprintf(3, "OP Admin %s at %s added %s to nickban list\n", user->nick, user->hostname, tempstr); | |
} | |
} | |
+ | |
+ else if(((user->permissions & BAN_ALLOW) != 0) && (strncasecmp(temp, "!gag ", 5) == 0)) |
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 greentext_filter_info() { | |
$filters['greentext'] = array( | |
'title' => t('Implying greentext'), | |
'description' => t('Allows you to alter any lines input starting with \'>\' to appear as greentext.'), | |
'process callback' => '_greentext_greentext', | |
'tips callback' => '_greentext_greentext_tips', | |
); | |
return $filters; |
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 | |
/** | |
* Implements hook_menu() | |
*/ | |
function mymodule_menu() { | |
$items['comment/%/fastdelete/%'] = array( | |
'title' => 'Fast Comment Deletion', | |
'page callback' => 'mymodule_comment_fastdelete', | |
'page arguments' => array(1, 3), |
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
sub db_connect() { | |
our $dbh = DBI->connect("dbi:SQLite:" . $path . '/' . $db,"","") or die "Unable to connect to database: $DBI::errstr"; | |
return $dbh; | |
} | |
sub db_prepare($) { | |
my $dbh = db_connect(); | |
my $query = shift; | |
my $handle = $dbh->prepare($query); | |
return $handle; |