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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
namespace Comparer | |
{ | |
public class SemiNumericComparer : IComparer<string> | |
{ | |
public int Compare(string s1, string s2) |
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
#Author: Matt Bungard / bungard at g-mail d com | |
# | |
#Pull bits from various sources, if you've been exluded let me know and I'll cite accordingly | |
#http://stackoverflow.com/questions/26737239/powershell-add-a-new-document-to-exisitng-word-file-with-page-number-of-2 | |
## -- Settings -- | |
#$fileNamePattern = "ID #:\s+(\d+)" | |
$fileNamePattern = "Student ID #:\s+# (\d+)" | |
$pageLength = 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
private static void SQLServerEscapeObject(object obj) | |
{ | |
foreach (System.Reflection.PropertyInfo property in obj.GetType().GetProperties()) | |
{ | |
try | |
{ | |
if (property.PropertyType.FullName == "System.String" && property.GetValue(obj, null) != null) | |
{ | |
property.SetValue(obj, property.GetValue(obj, null).ToString().Replace("'", "''"), null); | |
} |
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
Application Error: | |
Application: Plex.exe | |
Framework Version: v4.0.30319 | |
Description: The application requested process termination through System.Environment.FailFast(string message). | |
Message: The system cannot find the file specified. (Exception from HRESULT: 0x80070002) | |
Stack: | |
at System.Environment.FailFast(System.String, System.Exception) | |
at Plex.App+<FlushBugSenseAndFailFastAsync>d__47.MoveNext() | |
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) |
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
//As pulled from: http://support.microsoft.com/kb/306158 | |
static private bool impersonateValidUser(String userName, String domain, String password) | |
{ | |
WindowsIdentity tempWindowsIdentity; | |
IntPtr token = IntPtr.Zero; | |
IntPtr tokenDuplicate = IntPtr.Zero; | |
if (RevertToSelf()) | |
{ | |
if (LogonUserA(userName, domain, password, LOGON32_LOGON_INTERACTIVE, |
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
$query_select = "select lead.id "; | |
$query_from = ""; | |
$query_where = " where lead.form_id = $form_id"; | |
$query_order = ""; | |
if(!empty($orderby_field)) | |
$query_order = " ORDER BY " . preg_replace("([^0-9A-Za-z_])","",$orderby_field[0]["label"]) . ".value desc "; | |
$query_from .= " from wp_rg_lead lead | |
INNER JOIN wp_rg_lead_detail approval on lead.form_id = approval.form_id and lead.id = approval.lead_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
grep -lr --include \*.php --exclude \*id3v2.php "%x[0-9]" . | tee infected-files.txt | |
while read -r filename ; do | |
cp -v "$filename" "$filename.dirty" | |
sed -i "s/<?php \$\w\+ = '.*%x[0-9].*?>//g" "$filename" | |
done < infected-files.txt |
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
cp $1 $1.oldKey | |
AUTH_KEY=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'AUTH_KEY'" | sed 's/[^-A-Za-z0-9_]/\\&/g') | |
SECURE_AUTH_KEY=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'SECURE_AUTH_KEY'" | sed 's/[^-A-Za-z0-9_]/\\&/g') | |
LOGGED_IN_KEY=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'LOGGED_IN_KEY'" | sed 's/[^-A-Za-z0-9_]/\\&/g') | |
NONCE_KEY=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'NONCE_KEY'" | sed 's/[^-A-Za-z0-9_]/\\&/g') | |
AUTH_SALT=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'AUTH_SALT'" | sed 's/[^-A-Za-z0-9_]/\\&/g') | |
SECURE_AUTH_SALT=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'SECURE_AUTH_SALT'" | sed 's/[^-A-Za-z0-9_]/\\&/g') |
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
require 'rails/commands/server' | |
require 'socket' | |
module Rails | |
class Server | |
alias :default_options_alias :default_options | |
def default_options | |
ip_addr_list = Socket.ip_address_list | |
#puts ip_addr_list.inspect | |
if ip_addr_list.count >= 2 |
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
function parseExcel{ | |
param( | |
[string] $strFileName = $(throw "Please specify an excel file to parse."), | |
[string] $strSheetName = 'Sheet1$', | |
[string] $callListId = $(throw "Please specify a callListId.") | |
) | |
$strProvider = "Provider=Microsoft.Jet.OLEDB.4.0" | |
$strDataSource = "Data Source = $strFileName" | |
$strExtend = "Extended Properties=Excel 8.0" | |
$strQuery = "Select * from [$strSheetName]" |
NewerOlder