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 System;
struct Point
{
public int x;
public int y;
}
class Test
{
using System.Threading.Tasks;
class Test
{
static async Task Main()
{
// (Include the error message in the post.)
_ = await Condition() ? await M1() : await M2();
}
public class Test {
private String name;
public void printName(Test other) {
System.out.println(other.name);
}
}
using System;
public interface IFoo
{
void M(int x = 0);
}
public class Foo : IFoo
{
public void M(int x = 10)
class Test {
private void method1() {
private void method2() {
}
}
}
class Test
{
string name;
int value;
public Test(string name) : this(name, value)
{
}
public Test(string name, int value)
using ConsoleApp1;
using System.Reflection;
var property = typeof(Resource1).GetProperty("Default",
BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Static | BindingFlags.DeclaredOnly);
string value = (string) property.GetValue(null);
Console.WriteLine(value);
string original = "{\"name\":\"John\", \"age\":30, \"car\":null}";
string base64 = Base64Encode(original);
string decoded = Base64Decode(base64);
Console.WriteLine($"Original: {original}");
Console.WriteLine($"Base64: {base64}");
Console.WriteLine($"Decoded: {decoded}");
string Base64Encode(string plainText)
{
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
Imports System
Module Program
Sub Main(args As String())
Dim sName As String = "MyName"
Console.WriteLine(sName)
End Sub
End Module
import java.util.stream.*;
import javax.swing.*;
import java.awt.*;
public class Test {
public static void main(String[] args) throws Exception {
var frame = new JFrame();
var layout = new FlowLayout();
frame.setLayout(layout);
}