Skip to content

Instantly share code, notes, and snippets.

diff --git a/freetype/__init__.py b/freetype/__init__.py
index e175d52..e602d9c 100644
--- a/freetype/__init__.py
+++ b/freetype/__init__.py
@@ -30,15 +30,24 @@ import ctypes.util
__dll__ = None
__handle__ = None
FT_Library_filename = ctypes.util.find_library('freetype')
+
if not FT_Library_filename:
@pontusm
pontusm / gist:1907277
Created February 25, 2012 07:51
Retrieve computer uptime
public static TimeSpan GetUptime()
{
ManagementObject mo = new ManagementObject(@"\\.\root\cimv2:Win32_OperatingSystem=@");
DateTime lastBootUp = ManagementDateTimeConverter.ToDateTime(mo["LastBootUpTime"].ToString());
return DateTime.Now.ToUniversalTime() - lastBootUp.ToUniversalTime();
}
@pontusm
pontusm / StringExtensions.cs
Created January 26, 2012 07:26
ReplaceFormat string extension
/// <summary>
/// This class is used for replacing parts of a string with other content.
/// </summary>
public static class StringExtensions
{
public static string ReplaceFormat(this string str, string format, string replacement)
{
return ReplaceFormat(str, format, match => replacement);
}