Skip to content

Instantly share code, notes, and snippets.

View ktos's full-sized avatar

Marcin Badurowicz ktos

View GitHub Profile
#!/usr/bin/env python
# coding: utf-8
lines = []
with open('bbb.txt', 'r', encoding='utf-8') as f:
lines = f.readlines()
words = []
for i in lines:

Keybase proof

I hereby claim:

  • I am ktos on github.
  • I am ktos (https://keybase.io/ktos) on keybase.
  • I have a public key ASDtzB1tgkn3vdemEAKXnYhIaq5eBdUrP3yGGnGvXZNuewo

To claim this, I am signing this object:

@ktos
ktos / Program.cs
Created November 5, 2017 18:35
GuessTheNumber
using System;
namespace GuessTheNumber
{
class Program
{
static void Main(string[] args)
{
var r = new Random();
var number = r.Next(100);
private static async Task NewMethod()
{
StreamSocketListener ssl = new StreamSocketListener();
await ssl.BindServiceNameAsync("1234");
try
{
DnssdServiceInstance dns = new DnssdServiceInstance("instancename._servicename._tcp.local.", null, 1234);
var r = await dns.RegisterStreamSocketListenerAsync(ssl);
Console.WriteLine(r.Status);
public static string Serialize(object obj)
{
using (MemoryStream memoryStream = new MemoryStream())
using (StreamReader reader = new StreamReader(memoryStream))
{
DataContractSerializer serializer = new DataContractSerializer(obj.GetType());
serializer.WriteObject(memoryStream, obj);
memoryStream.Position = 0;
return reader.ReadToEnd();
}

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1,SHA256

GPG transition statement: Marcin "Ktos" Badurowicz

I am transitioning GPG keys from very old 1024 bit DSA key into a new 4096-bit RSA key. The old key will continue to be valid for about 6 weeks, but I prefer all new correspondence to be encrypted in the new key, and will be making all signatures going forward with the new key.

@ktos
ktos / clean-vssolution.ps1
Created January 22, 2015 16:09
A small script to remove all files from Visual Studio solution which aren't important for other users (*.suo, *.user, caches, build versions)
# clean-vssolution.ps1
#
# Cleans Visual Studio Solution folder
# removing .suo, .user, build and obj folders
Param ($folder = ".")
$include = @("*.suo", "*.user", "*.cache", "bin", "obj", "build")
$exclude = @()

Keybase proof

I hereby claim:

  • I am ktos on github.
  • I am ktos (https://keybase.io/ktos) on keybase.
  • I have a public key whose fingerprint is 86AB 78AD 9003 03D7 4664 31D6 AC85 C529 C27E 20F1

To claim this, I am signing this object: