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 static string UrlCombine(string baseUrl, string resource) | |
{ | |
if (baseUrl.Length == 0) | |
{ | |
return baseUrl; | |
} | |
if (resource.Length == 0) | |
{ | |
return resource; |
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 System.Diagnostics; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
using AgFx; | |
using RestSharp; | |
using RestSharp.Authenticators; | |
namespace Librarian.AgFx |
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
public void AuthenticateUser(Action<AuthorizedUser> completed, Action<Exception> error) | |
{ | |
EnsureIsAuthenticated(); | |
AuthorizedUser = DataManager.Current.LoadFromCache<AuthorizedUser>("authenticated_user"); | |
// LoadFromCache returns an object even if it didn't exist in the | |
// cache so check one of its properties for existance vs. the object | |
// itself. | |
if (!String.IsNullOrEmpty(AuthorizedUser.Id)) |
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.Collections.Generic; | |
using System.Collections.ObjectModel; | |
namespace Librarian.Common | |
{ | |
public static class Enumerable | |
{ | |
public static ObservableCollection<TSource> ToObservable<TSource>(this IEnumerable<TSource> source) | |
{ | |
return new ObservableCollection<TSource>(source); |
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
Show hidden characters
{ | |
"cmd": ["msbuild"], | |
"path": "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319", | |
"working_dir": "${project_path:${folder}}", | |
"file_regex": "^ (.*)\\(([0-9]*),([0-9]*)" | |
} |
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
<snippet> | |
<tabTrigger>propc</tabTrigger> | |
<content><![CDATA[ | |
private ${1:string} _${2}; | |
public ${1} ${2/./\u$0/} | |
{ | |
get | |
{ | |
return _${2}; | |
} |
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
from pygments import highlight | |
from pygments.lexers import PythonLexer, JsonLexer | |
from pygments.formatters import TerminalFormatter | |
from pprint import pformat | |
def ap(obj): | |
'''Faked Awesome Print''' | |
print(highlight(pformat(obj), PythonLexer(), TerminalFormatter())) |