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
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel.Composition; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Reflection; | |
| using System.Text.RegularExpressions; | |
| using System.Threading.Tasks; | |
| using Core.Abstractions; | |
| using Lucene.Net.Documents; |
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
| $output = git status | |
| $branchbits = $output[0].Split(' ') | |
| $branch = $branchbits[$branchbits.length - 1] | |
| $signature = @" | |
| [DllImport("user32.dll")] | |
| public static extern bool SetWindowText(IntPtr hWnd, string lpString); | |
| "@ |
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
| #if DEBUG | |
| public class ResetCacheOnDefaultWidgetChangePlugin : IPlugin | |
| { | |
| public void Initialize() | |
| { | |
| SetupFileSystemWatcher(); | |
| } | |
| private void SetupFileSystemWatcher() | |
| { |
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
| function Get-EndlineFormat { | |
| param($filepath) | |
| # by default get-content reads one 'item' at a time. | |
| # and reading 1 byte at a time will take a long long time | |
| # -ReadCount 0 makes it read it all at once. | |
| $bytes = get-content -encoding byte -ReadCount 0 $filepath | |
| $string = [Text.Encoding]::Ascii.GetString($bytes, 0, $bytes.Count) | |
| $is_unix = ([regex] "[^`r]`n").Matches($string).Count -gt 0 ` | |
| -and ([regex] "`r`n").Matches($string).Count -eq 0 |
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
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using Raven.Client; | |
| using Raven.Client.Embedded; | |
| using Raven.Client.Indexes; | |
| namespace ConsoleApplication5 | |
| { | |
| class Program |
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
| internal class DeobfuscateString | |
| { | |
| private readonly string[] _args; | |
| private MethodInfo _method; | |
| private string _assemblyPath; | |
| private DeobfuscateString(string[] args) | |
| { | |
| _args = args; | |
| } |
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
| # gist: https://gist.github.com/4397669 | |
| import logging, requests, simplejson | |
| from datetime import datetime | |
| dthandler = lambda obj: obj.isoformat() if isinstance(obj, datetime) else None | |
| def dumps(obj): | |
| return simplejson.dumps(obj, use_decimal=True, default=dthandler) | |
| l = logging.getLogger("ravendb") |
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
| # gist: https://gist.github.com/4397792 | |
| # Usage: | |
| # session = cgd.CgdSession(uid, password) | |
| # session.login() | |
| # session.load_latest_transactions(account_key) | |
| # 'session.known_accounts' is now populated with the initial accounts taken from the login response, | |
| # and the data for the 'account_key' account. | |
| # session.load_latest_transactions(account_key) loads the latest transactions and balances for a given account. |
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
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Net; | |
| using Glimpse.Core.Extensibility; | |
| using Glimpse.Core.Framework; | |
| using Glimpse.Core.ResourceResult; | |
| namespace weListen.Infrastructure | |
| { | |
| public class GlimpseServiceLocator : IServiceLocator |
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
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using ServiceStack; | |
| using ServiceStack.Auth; | |
| namespace Test | |
| { | |
| public class CustomAuthUserSession : AuthUserSession | |
| { | |
| public string UserId { get; set; } |