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 string WrapText(string text) { | |
if(font.MeasureString(text).X < MaxLineWidth) { | |
return text; | |
} | |
string[] words = text.Split(' '); | |
StringBuilder wrappedText = new StringBuilder(); | |
float linewidth = 0f; | |
float spaceWidth = font.MeasureString(" ").X; | |
for(int i = 0; i < words.Length; ++i) { |
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
public class MyClass { | |
private readonly ComplexClass complexClass; | |
public MyClass(ComplexClass complexClass) { | |
this.complexClass = complexClass; | |
} | |
public void Verify() { | |
((IVerifiable)complexClass).Verify(); | |
} |
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 Stopwatch testTimer; | |
[ClassInitialize] | |
public static void ClassInit(TestContext testContext) | |
{ | |
testTimer = new Stopwatch(); | |
testTimer.Start(); | |
} | |
[ClassCleanup] |
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> | |
/// Used to call methods asynchronously and continue with with other methods | |
/// after execution completes. Very useful in View Models. | |
/// </summary> | |
public class AsyncMethodCaller : IAsyncMethodCaller | |
{ | |
/// <summary> | |
/// The final <see cref="Task"/> to be executed, can be awaited. | |
/// </summary> | |
protected Task CurrentTask; |
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
on run {input, parameters} | |
tell application "Finder" | |
tell front Finder window to set target to parent of target | |
end tell | |
return input | |
end run |
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
/* | |
* Created on 22.apr.2005 | |
*/ | |
package sys; | |
import nett.*; | |
/** | |
* @author Uno, hjerpbak | |
*/ |
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
/System/Library/Frameworks/CoreServices.framework//Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user |
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/python | |
import smtplib | |
import string | |
def send_email(to_address, subject, body): | |
from_address = '' | |
username = from_address | |
password = '' | |
email = string.join(( |
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
for f in "$@" | |
do | |
if [ ${f: -4} == ".svg" -o ${f: -4} == ".SVG" ] | |
then | |
python /Applications/Utilities/scour/scour.py --enable-comment-stripping --create-groups --enable-id-stripping --shorten-ids --set-precision=5 --quiet --indent=none -i "$f" -o "$f 2" | |
mv "$f 2" "$f" | |
fi | |
done |
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
<InstallExecuteSequence> | |
<RemoveExistingProducts After="InstallFinalize"></RemoveExistingProducts> | |
</InstallExecuteSequence> |