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
<script language="JavaScript" type="text/javascript"> | |
// Copyright (C) 2013 Comcast Cable Communications, LLC | |
// Intended use of this message is to display critical and time sensitive notifications to customers. | |
/* | |
This program is free software; you can redistribute it and/or | |
modify it under the terms of the GNU General Public License | |
as published by the Free Software Foundation; either version 2 | |
of the License, or (at your option) any later version. |
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
# Fix oEmbed for HTTPS | |
add_filter('oembed_providers', function ($providers) { | |
$new_providers = array(); | |
foreach ($providers as $key => $value) { | |
$matchmask = $key; | |
$providerurl = $value[0]; | |
$regex = $value[1]; | |
# Convert simple-style to full regex (assuming all regexes use # as delimiter) |
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
diff --git a/admin/your_subscriptions.php b/admin/your_subscriptions.php | |
index ddf74ae..97dbba5 100755 | |
--- a/admin/your_subscriptions.php | |
+++ b/admin/your_subscriptions.php | |
@@ -7,7 +7,7 @@ global $user_ID, $s2nonce; | |
if ( isset($_GET['email']) ) { | |
global $wpdb; | |
- $user_ID = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_email = '" . urldecode($_GET['email']) . "'"); | |
+ $user_ID = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_email = %s", urldecode($_GET['email']))); |
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/sh | |
set -e | |
test X$1 == X && echo 'Args plox' && exit 1 || | |
## Manual configuration | |
VHOST_DIR=/var/vhosts | |
VHOST_CONF=/etc/httpd/conf/extra/httpd-vhosts.conf |
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 python | |
import csv | |
import numpy | |
data = [] | |
for row in csv.reader(open('votes.csv')): | |
data.append(row) |
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
import subprocess | |
def git(cmd, *args): | |
return subprocess.Popen(['git',cmd]+list(args), stdout=subprocess.PIPE).communicate()[0].decode() | |
def leaf(tree, pos): | |
while True: | |
if len(pos) == 0: | |
return tree |
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 python | |
import socket | |
def uzblctrl(socket_file, input): | |
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | |
sock.connect(socket_file) | |
sock.settimeout(0.5) # 500ms | |
sock.send(input+'\n') |
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
# Copy/pasted from http://gist.github.com/152929 | |
import json | |
import re | |
import urllib2 | |
class PostcodeLookupError(Exception): | |
pass | |
def from_postcode(postcode): |
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
var theme = "crystal"; | |
function toggle(app) { | |
var this_app = document.getElementById(app); | |
var is_small = false; | |
if (class_contains(this_app, 'app_small')) { | |
is_small = true; | |
} | |
if (this_app.style.display=="block") { | |
this_app.style.display="none"; |
NewerOlder