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
Function.prototype.callAsWorker = function (context, args) { | |
return new Promise((resolve, reject) => { | |
const code = ` | |
${context ? [...context].reduce((acc, cur) => acc + cur.toString() + '\n') : ''} | |
self.onmessage = async function (e) { | |
const result = await ( ${this.toString()}.call(null, e.data) ); | |
self.postMessage( result ); |
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
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | | |
Get-ItemProperty -name Version,Release -EA 0 | | |
Where { $_.PSChildName -match '^(?!S)\p{L}'} | | |
Select PSChildName, Version, Release |
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
#run latest SDK alpine-3.12 image with dump capabilities | |
docker run -it --rm --cap-add=SYS_PTRACE mcr.microsoft.com/dotnet/core/sdk:3.1-alpine | |
#we'll be using git | |
apk add git | |
#some trivialities | |
alias ll='ls -lah --color' | |
cd /srv/ | |
#clone my repo with tests |
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
*PPD-Adobe: "4.3" | |
*%%%% PPD file for SCX-3200 with CUPS. | |
*%%%% Created by the CUPS PPD Compiler CUPS v1.5.0. | |
*FormatVersion: "4.3" | |
*FileVersion: "2.0.0" | |
*LanguageVersion: English | |
*LanguageEncoding: ISOLatin1 | |
*PCFileName: "scx3200.ppd" | |
*Product: "(SCX-3200)" | |
*Manufacturer: "Samsung" |
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
async Task<double> ComputeStuffAsync(CancellationToken token) | |
{ | |
var tsk = Task.Run(() => | |
{ | |
var sum = 0.0; | |
int DOP = 4; | |
Parallel.For(0, DOP - 1, new ParallelOptions { MaxDegreeOfParallelism = DOP, CancellationToken = token }, | |
// Initialize the local states | |
() => (double)0.0, |
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
diff --git a/test/WebSites/Basic/Basic.csproj b/test/WebSites/Basic/Basic.csproj | |
index f38e99c..a5c8cf7 100644 | |
--- a/test/WebSites/Basic/Basic.csproj | |
+++ b/test/WebSites/Basic/Basic.csproj | |
@@ -1,7 +1,7 @@ | |
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<PropertyGroup> | |
- <TargetFramework>netcoreapp2.0</TargetFramework> | |
+ <TargetFramework>net461</TargetFramework> |
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
[HttpGet] | |
public async Task<IActionResult> Load(string sort, string order, string search, int limit, int offset, string extraParam) | |
{ | |
CancellationToken token = HttpContext.RequestAborted; | |
try | |
{ | |
var found = await _repo.SearchAsync(sort, order, search, offset, limit, token); | |
var result = new | |
{ |
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
diff --git a/samples/MemoryCacheConcurencySample/MemoryCacheConcurencySample.csproj b/samples/MemoryCacheConcurencySample/MemoryCacheConcurencySample.csproj | |
index b024bae..c758d72 100644 | |
--- a/samples/MemoryCacheConcurencySample/MemoryCacheConcurencySample.csproj | |
+++ b/samples/MemoryCacheConcurencySample/MemoryCacheConcurencySample.csproj | |
@@ -3,7 +3,8 @@ | |
<Import Project="..\..\build\dependencies.props" /> | |
<PropertyGroup> | |
- <TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks> | |
+ <TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net461</TargetFrameworks> |
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
public static class SessionExtensions | |
{ | |
public static void Set<T>(this ISession session, string key, T value) | |
{ | |
session.SetString(key, JsonConvert.SerializeObject(value)); | |
} | |
public static T Get<T>(this ISession session, string key) | |
{ | |
var value = session.GetString(key); |
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
# DOCKER-VERSION 1.12.0-rc4 | |
# Tor Over VNC | |
FROM ubuntu:14.04 | |
RUN apt-get update | |
#RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
# We need sudo because some post install stuff runs with tor | |
RUN apt-get install -y python-software-properties software-properties-common python3-software-properties sudo wget | |
RUN add-apt-repository -y ppa:upubuntu-com/tor && apt-get update |
NewerOlder