Skip to content

Instantly share code, notes, and snippets.

View jskeet's full-sized avatar
💭
Very happily employed. I do not wish to hear from recruiters.

Jon Skeet jskeet

💭
Very happily employed. I do not wish to hear from recruiters.
View GitHub Profile
using NUnit.Framework;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace EventTest2;
public static class Extensions
{
private const int DEFAULT_HANDLE_POLLING_INTERVAL = 50; // ms
using System.Net.Sockets;
string host = "192.168.1.45";
int port = 5678;
byte[] getPowerCommand = { 0x81, 0x09, 0x04, 0x00, 0xff };
// Create two clients - these will connect immediately
var client1 = new TcpClient(host, port);
client1.NoDelay = true;
using System;
var foo = new Foo();
Console.WriteLine(foo.ToString());
public interface IFoo : IFormattable
{
}
public class Foo : IFoo
using Google.Cloud.BigQuery.V2;
if (args.Length != 4)
{
Console.WriteLine("Expected arguments: <project-id> <dataset-id> <table-id> <csv-storage-url>");
return;
}
string projectId = args[0];
string datasetId = args[1];
using System;
using Xunit;
namespace AssertThrows;
public class UnitTest1
{
[Fact]
public void Test1()
{
using System;
using System.Collections.Generic;
using System.Linq;
public class Test
{
static void Main()
{
List<string> names = new List<string>
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
class Foo
{
}
class Test
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void main(String[] args) throws Exception {
List<Superclass> supers = new ArrayList<>();
supers.add(new Superclass());
showElementTypes(supers);
}
import java.text.*;
import java.util.*;
public class Test {
public static void main(String[] args) throws Exception {
String text = "Mon Oct 11 19:00 2021";
String format = "EE MMM dd HH:mm yyyy";
SimpleDateFormat simpleDateFormat =new SimpleDateFormat(format, new Locale("en", "EN"));
Date date = simpleDateFormat.parse(text);
@jskeet
jskeet / Test.cs
Created September 22, 2021 10:58
using System;
class Test
{
static void Main()
{
var initialTicks = 621356256000000000L;
var dt1 = new DateTime(621356256000000000L);
long ticksToAdd = 2083980640;
dt1 = dt1.AddTicks(ticksToAdd);