Skip to content

Instantly share code, notes, and snippets.

View jeremymeng's full-sized avatar

Jeremy Meng jeremymeng

View GitHub Profile
appveyor DownloadFile https://github.com/nunit/nunit/releases/download/3.0.0/NUnit-3.0.0.zip
7z x -oC:\Tools\NUnit3 nunit-3.0.0.zip > NUL
copy C:\Tools\NUnit3\bin\nunit3-console.exe C:\Tools\NUnit3\bin\nunit-console.exe
set PATH=C:\Tools\NUnit3\bin;%PATH%
@jeremymeng
jeremymeng / install.sh
Last active August 27, 2021 07:36
packages to install on a new linux vm
sudo apt-get install zip unzip curl make automake libtool build-essential git screen libgtk-3-0 libsm6 libx11-xcb1 libxft2 libtiff5 libgif7 libxpm4 ispell libncurses5 libgnutls30 libxml2
# to build emacs with gtk gui
sudo apt-get install libgtk-3-dev libxpm-dev libtiff5-dev libjpeg8-dev libgif-dev libgnutls28-dev libncurses5-dev libxml2-dev
# emacs 27.1
sudo apt install -y autoconf automake autotools-dev bsd-mailx build-essential \
diffstat gnutls-dev imagemagick libasound2-dev libc6-dev libdatrie-dev \
libdbus-1-dev libgconf2-dev libgif-dev libgnutls28-dev libgpm-dev libgtk2.0-dev \
libgtk-3-dev libice-dev libjpeg-dev liblockfile-dev liblqr-1-0 libm17n-dev \
This file has been truncated, but you can view the full file.
Processing language service changes for 'C:\github\jeremymeng\dotnet-apiport\src\lib\Microsoft.Fx.Portability.Offline\Microsoft.Fx.Portability.Offline.csproj' [Debug|AnyCPU]...
Version: 0
Source: Evaluation
IsActiveContext: True
Processing rule 'Compile'...
Adding source file 'C:\github\jeremymeng\dotnet-apiport\src\lib\Microsoft.Fx.Portability.Offline\OfflineDataModule.cs'
Adding source file 'C:\github\jeremymeng\dotnet-apiport\src\lib\Microsoft.Fx.Portability.Offline\Data.cs'
Adding source file 'C:\github\jeremymeng\dotnet-apiport\src\lib\Microsoft.Fx.Portability.Offline\OfflineBreakingChanges.cs'
Adding source file 'C:\github\jeremymeng\dotnet-apiport\src\lib\Microsoft.Fx.Portability.Offline\OfflineApiRecommendations.cs'
@jeremymeng
jeremymeng / Dockerfile
Last active April 18, 2018 00:04
aspnetcore with perfcollect
FROM microsoft/aspnetcore
# install various tools that are required by perfcollect
RUN apt-get update \
&& apt-get -y install zip unzip binutils htop \
linux-tools lttng-tools liblttng-ust-dev
RUN mkdir /tools \
&& curl -L http://aka.ms/perfcollect > /tools/perfcollect \
&& chmod +x /tools/perfcollect
{
"ignition": { "version": "2.2.0" },
"passwd": {
"users": [
{
"name": "core",
"passwordHash": "abc123!@#",
"sshAuthorizedKeys": [
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIB4sLpLe47zqP2yPXJA2RW1/LXEqOJmte19cr8LlyukIV6YSSfIAlZm9w4xpYaDb7ZJzAtQOMi8smabN/3Ib43KDIxKmUcyz9k3N76JJLDWndQ3ti59wk7QNMbPslK3+7lUacLut4l+BjYNFExu4ZyQb7ke5EIONrMDyEReONzkDQ== rsa-key-20160322"
]
@jeremymeng
jeremymeng / Dockerfile
Created March 1, 2019 21:39
Dockerfile for application and sidecar
FROM microsoft/dotnet:2.2-sdk AS builder
WORKDIR /build
COPY *.csproj .
# Restore with `-r linux-x64` to download the runtime package containing crossgen.
RUN dotnet restore -r linux-x64
RUN cp `find ~/.nuget/packages -name crossgen` .
# Restore without `-r` option so that the shared runtime will be used to run the app.
RUN dotnet restore

Metrics Advisor champion scenarios

Creating Metrics Advisor clients

const {
  MetricsAdvisorKeyCredential,
  MetricsAdvisorClient,
  MetricsAdvisorAdministrationClient
} = require("@azure/ai-metrics-advisor");
const client = new BlobServiceClient(url);
async function testUploadProgress() {
const containerClient = client.getContainerClient("jeremy-test");
const blockBlobClient = containerClient.getBlockBlobClient(
"test-upload-progress"
);
const selectedFile = document.getElementById("input").files[0];
const status = document.getElementById("status");
await blockBlobClient.stageBlock(btoa("1"), selectedFile, selectedFile.size, {
@jeremymeng
jeremymeng / blobProperties.ts
Last active February 17, 2022 22:09
workaround for @azure/blob-storage metadata from getProperties() casing issue
import {
BlobServiceClient,
ContainerClient,
StorageSharedKeyCredential,
} from "@azure/storage-blob";
import { ExampleHttpClient } from "./exampleHttpClient.js";
import * as dotenv from "dotenv";
dotenv.config();
@jeremymeng
jeremymeng / rush-project-folder.sh
Last active March 11, 2022 19:33
jq project folder
strip-json-comments rush.json | jq -c '.projects | map(select(.versionPolicyName | contains("management") | not)) | sort_by(.projectFolder) | .[]' > /workspaces/notes/rush-non-mgmt.log