This file contains 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
1, 1. SemaphoreSlim. Time = 13ms | |
1, 1. SemaphoreSlim. Time = 11ms | |
1, 1. SemaphoreSlim. Time = 11ms | |
1, 1. SemaphoreSlim. Time = 11ms | |
1, 1. SemaphoreSlim. Time = 12ms | |
1, 1. SemaphoreSlim. Time = 12ms | |
1, 1. SemaphoreSlim. Time = 12ms | |
1, 1. SemaphoreSlim. Time = 12ms | |
1, 1. SemaphoreSlim. Time = 11ms | |
1, 1. SemaphoreSlim. Time = 11ms |
This file contains 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
// Find used space | |
df -h | |
du -h / | grep '[0-9\.]\+G' | |
du -h --max-depth=1 | sort -hr | |
/bin/treesize | |
#/bin/sh | |
du -k --max-depth=1 | sort -nr | awk ' | |
BEGIN { | |
split("KB,MB,GB,TB", Units, ","); |
This file contains 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 scala.collection.mutable | |
import scala.io.BufferedSource | |
import scala.collection.mutable.ListBuffer | |
val linkToSpreadsheet = "https://docs.google.com/spreadsheets/d/1wce5rPQ-g8I-cIkL_e2eVsau52m6OSe5uoKh5Xk4lfE" | |
val linkToTabSeparatedData = linkToSpreadsheet + "/export?format=tsv" | |
def source = io.Source.fromURL(linkToTabSeparatedData) | |
//def source = io.Source.fromFile("C:\\Projects\\my\\LambdaConfTicket\\src\\main\\resources\\data.tsv") | |
case class Talk(name: String, value: Int, length: Int, scheduled: Boolean) |
This file contains 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
<# | |
.SYNOPSIS | |
Find all files excluded from a Visual Studio solution with options to delete. | |
.DESCRIPTION | |
Finds all excluded files in all projects in the provided Visual Studio solution with options to delete the files. | |
.PARAMETER Solution | |
The path to the .sln file |
This file contains 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
// from the package repository | |
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list | |
sudo apt-get update | |
sudo apt-get install sbt | |
// or from the deb package | |
wget http://dl.bintray.com/sbt/debian/sbt-0.13.7.deb | |
sudo dpkg -i sbt-0.13.7.deb | |
sudo apt-get install -f |
This file contains 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
// remove untracked files, including directories (-d) and files ignored by git (-x) to force (-f) to exclude files (-e) | |
git clean -n -d -x -e ".idea" | |
// compare content of moved folder | |
git diff --ignore-space-change \ | |
HEAD:source/oldDir/someDir \ | |
HEAD~1:source/newDir/someDir/ | |
// delete merged local branches (use "| xargs -n 1 echo" if not sure) | |
git branch --merged | grep -v master | sed 's/origin\///' | xargs -n 1 git branch -d |
This file contains 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; | |
namespace LanguageDetection | |
{ | |
public class AhoCorasickTree | |
{ | |
private readonly AhoCorasickTreeNode _rootNode; | |
public AhoCorasickTree(IEnumerable<Tuple<string, int>> mapings) |
This file contains 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 scala.collection.mutable.LinkedHashMap | |
val catFile = Seq("1\0012\0013\0014", "5\0016\0017\0018") | |
var categoryMap = LinkedHashMap[ Int, Tuple2[ String, Int ] ]() | |
catFile.foreach(line => { | |
val strs = line.split("\001") | |
categoryMap += (strs(0).toInt ->(strs(2), strs(3).toInt)) | |
}) | |
categoryMap |
This file contains 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.Net; | |
using System.Net.Http; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace HttpClientMemoryLeak | |
{ | |
class Program |
This file contains 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.Net.Http; | |
using System.Threading.Tasks; | |
namespace HttpClientMemoryLeak | |
{ | |
class Program | |
{ | |
public static async Task TestMethod() | |
{ |