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
### Keybase proof | |
I hereby claim: | |
* I am slmcmahon on github. | |
* I am slmcmahon (https://keybase.io/slmcmahon) on keybase. | |
* I have a public key whose fingerprint is 5EDF 98DD DF62 2F0A D425 6173 93DA CB79 C1F8 E531 | |
To claim this, I am signing this object: |
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
private string GetDataFromResults(SearchResult result, string propertyName) | |
{ | |
if (!result.Properties.Contains(propertyName) || result.Properties[propertyName].Count == 0) | |
{ | |
return null; | |
} | |
var prop = result.Properties[propertyName][0]; | |
var data = prop.GetType() == typeof (byte[]) | |
? Encoding.UTF8.GetString((byte[]) prop) |
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
declare | |
@test nvarchar(500), | |
@idx int, | |
@c nchar(1) | |
set @idx = 1 | |
set @test = 'Nå er tiden for alle gode menn til å komme til unnsetning for landet sitt.' | |
while @idx < LEN(@test) | |
begin |
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
/* | |
This is a convenience class for storing login credentials | |
This depends on SFHFKeychainUtils from http://github.com/ldandersen/scifihifi-iphone/tree/master/security | |
and you must add Security.framework to your project | |
*/ | |
/********************************************** | |
//CredentialManager.h | |
#import <Foundation/Foundation.h> |
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
Converts properties to synthesizers | |
1. :%s/@property (\(.*, \|\).*)\s.*\s\**\(.*\);/@synthesize \2;/g | |
2. :%s/@property (\(.*, \|\).*)\s.*\s\**\(.*\);/@synthesize \2 = _\2;/g | |
Converts properties to release calls | |
3. :%s/@property (\(.*, \|\).*)\s.*\s\**\(.*\);/ [_\2 release]; _\2 = nil;/g | |
Example: | |
input: |
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
using System; | |
using NUnit.Framework; | |
namespace NumberConversions | |
{ | |
[TestFixture] | |
public class ConversionTests | |
{ | |
private const string VALID_NUMBER = "12345"; | |
private const string INVALID_NUMBER = "BR549"; |
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
// need this to be able to run in .net 2.0. The result of this is to be sent up | |
// to the server by the client so that we can determine what versions of the | |
// .net framework that our users have installed | |
private string GetAvailableFrameworks() | |
{ | |
string frameworkRegistryPath = @"Software\Microsoft\.netframework"; | |
List<string> versions = new List<string>(); | |
RegistryKey key = Registry.LocalMachine.OpenSubKey(frameworkRegistryPath); | |
if (key == null) | |
{ |
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
namespace AppServer.Models | |
{ | |
/// <summary> | |
/// This is a generic server response container that provides a way to | |
/// transfer any serializable type between the client and the server with | |
/// meta info about the data being transferred | |
/// </summary> | |
/// <typeparam name="T">The type of the Payload Property</typeparam> | |
public class ServerResponse<T> | |
{ |
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
package com.yourgwtapp.client.dto; | |
import com.google.gwt.core.client.JavaScriptObject; | |
public class ServerResponse<T extends JavaScriptObject> extends JavaScriptObject { | |
protected ServerResponse() { } | |
public final native T getPayload() /*-{ return this.Payload; }-*/; | |
public final native boolean getSuccess() /*-{ return this.Success; }-*/; |
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
- (NSDate *)convertXmlDate:(NSString *)xmlDate { | |
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; | |
[dateFormat setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS"]; | |
NSDate *date = [dateFormat dateFromString:xmlDate]; | |
[dateFormat release]; | |
return date; | |
} |
OlderNewer