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
User u = [ SELECT Id from User Where Name = 'Some Person'].get(0); | |
Opportunity opp = [ Select AccountExecutive__r.Name from Opportunity Where id = 'XXX123' ].get(0); | |
opp.AccountExecutive__c = u.Id; | |
update opp; |
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
declare module 'raygun' { | |
interface RaygunOptions { | |
apiKey: string, | |
host?: string, | |
port?: number, | |
useSSL?: boolean | |
} | |
export class Client { |
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
{ | |
"customer": { | |
"firstName": "Adam", | |
"lastName": "Witko", | |
"bankAccount" : { | |
"number": "92827182", | |
"sortCode": "991122" | |
} | |
}, | |
"payment": { |
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
{ | |
"customer": { | |
"firstName": "Adam", | |
"lastName": "Witko" | |
}, | |
"payment": { | |
"amount": 100, | |
"frequency": 2, | |
"date": "2015-05-05T23:59:59.120Z", | |
"bankAccount" : { |
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
$Version = "5.1.2" | |
$NewVersion = 'AssemblyVersion("' + $Version + '")'; | |
$NewFileVersion = 'AssemblyFileVersion("' + $Version + '")'; | |
Get-ChildItem .\ -Recurse -Filter AssemblyInfo.cs | % ` | |
{ | |
$FilePath = $_.FullName; | |
$TmpFile = $filePath + ".tmp" | |
Get-Content $FilePath | |
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
def test(): | |
import logging | |
from iis import parse_iis | |
logging.basicConfig(level=logging.DEBUG) | |
test_input="2015-03-05 08:39:06 ::1 GET / - 89 - ::1 Mozilla/5.0+(Windows+NT+6.3;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/40.0.2214.115+Safari/537.36 - 403 14 0 7" | |
expected = ( | |
"iis.test", |
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
import time | |
from datetime import datetime | |
def parse_iis(logger, line): | |
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken | |
line_date, line_time, server_ip, cs_method, cs_uri_stem, cs_uri_query, server_port, cs_username, client_ip, cs_user_agent, cs_referer, status_code, sub_status, win32_status, time_taken = line.split() | |
dt = datetime.strptime(line_date+"T"+line_time, "%Y-%m-%dT%H:%M:%S") | |
dt = time.mktime(dt.timetuple()) |
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 Program | |
{ | |
private static readonly int[] _denominations = {1, 2, 5}; | |
private static void Main(string[] args) | |
{ | |
const int total = 6; | |
var result = GetCount(amount, 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
public class DecompressionHandler : DelegatingHandler | |
{ | |
protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) | |
{ | |
if (request.Content.Headers.ContentEncoding.Select(e => e.ToLowerInvariant()).Contains("gzip")) | |
{ | |
var inputStream = await request.Content.ReadAsStreamAsync(); | |
using (var memoryStream = new MemoryStream()) | |
{ | |
using (var outputStream = new GZipStream(inputStream, CompressionMode.Decompress, leaveOpen: true)) |