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
//used to convert strings to a usable string in MessageBox, example: | |
//std::wstring stemp = s2ws(executablePath); | |
//MessageBox(0, stemp.c_str(), L"", MB_OK); | |
//https://stackoverflow.com/a/27296 | |
std::wstring s2ws(const std::string& s) | |
{ | |
int len; | |
int slength = (int)s.length() + 1; | |
len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0); | |
wchar_t* buf = new wchar_t[len]; |
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
#Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
; # is WinKey, + is shift | |
; https://www.autohotkey.com/docs/Tutorial.htm#s2 | |
; https://autohotkey.com/board/topic/70048-ituneswindows-media-playerwinamp-autohotkey-script/ |
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
@keyframes yellowfade { | |
from { background: yellow; } | |
to { background: transparent; } | |
} | |
.new-item { | |
animation-name: yellowfade; | |
animation-duration: 1.5s; | |
} |
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
/// <summary> | |
/// Sets an error to display on the next postback. This will NOT survive a redirect, use RedirectWithErrorResult! | |
/// </summary> | |
/// <param name="error"></param> | |
public void SetPostBackError(string error) | |
{ | |
this.ViewBag.Error = error; | |
} | |
/// <summary> |
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
var inquery = from en in Course_Enrollments | |
from t in ( | |
(from enr in Course_Enrollments | |
join usr in User_Users on enr.UserID equals usr.UserID | |
join offr in Course_CourseOfferings on enr.CourseOfferingID equals offr.CourseOfferingID | |
where offr.CourseOfferingID == 92 && enr.UserID == en.UserID | |
orderby enr.ModifiedDate | |
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
# http://www.dd-wrt.com/wiki/index.php/Switched_Ports#Second_WAN_port | |
# http://wiki.openwrt.org/toh/asus/wl500gp | |
# tested on an ASUS WL-520gu | |
# LAN4 was 4, so I made port 0 (WAN) bridge with port 4 (LAN4) | |
nvram set vlan0ports="1 2 3 5*" | |
nvram set vlan1ports="0 4 5" | |
#verify results | |
nvram find vlan |
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
/Applications/Adium.app/Contents/Resources/Contact List | |
/Applications/Adium.app/Contents/Resources/Dock Icons | |
/Applications/Adium.app/Contents/Resources/Emoticons | |
/Applications/Adium.app/Contents/Resources/Menu Bar Icons | |
/Applications/Adium.app/Contents/Resources/Message Styles | |
/Applications/Adium.app/Contents/Resources/Scripts | |
/Applications/Adium.app/Contents/Resources/Service Icons | |
/Applications/Adium.app/Contents/Resources/Sounds | |
/Applications/Adium.app/Contents/Resources/Status Icons | |
~/Library/Application Support/Adium 2.0/Contact List |
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
/// <summary> | |
/// Clones all public properties and fiels on one object to another (excluding index based properties). The properties | |
/// must have the same name scheme. Type does not matter. | |
/// </summary> | |
/// <param name="o"></param> | |
/// <param name="destination">Where to clone the properties to.</param> | |
public static void ClonePublicPropertiesAndFields(this object o, object destination) | |
{ | |
if (destination == null) throw new ArgumentNullException("destination", "Destination cannot be 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
/// <summary> | |
/// Dynamically casts a type to another type without knowing the CLR knowing the object's type. Before calling this method, | |
/// ensure the object's type matches what you are trying to cast to! | |
/// </summary> | |
/// <exception cref="System.InvalidCastException"></exception> | |
public static dynamic DynamicCast(this Type T, dynamic o) | |
{ | |
return typeof(ReflectionHelpers).GetMethod("Cast", BindingFlags.Static | BindingFlags.NonPublic) | |
.MakeGenericMethod(T).Invoke(null, new object[] { o }); | |
} |
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
/// <summary> | |
/// Returns a string containing all of the public properties and fields for a given type. | |
/// </summary> | |
/// <param name="o">Type to print properties and fields for.</param> | |
/// <returns>Properties and fields seperated by newlines.</returns> | |
public static string PrintPublicPropertiesAndFields(this object o, string seperator = "\r\n") | |
{ | |
StringBuilder sb = new StringBuilder(); | |
Type otype = o.GetType(); |
NewerOlder