Skip to content

Instantly share code, notes, and snippets.

View devhawk's full-sized avatar

Harry Pierson devhawk

View GitHub Profile
@devhawk
devhawk / vsdevcmd.yml
Last active November 1, 2023 21:42
Locate vsdevcmd in azure pipelines
parameters:
buildArchitecture: 'x86' # defaults for any parameters that aren't specified
hostArchitecture: 'x86'
steps:
- script: |
@echo off
set vswherepath="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
for /f "usebackq delims=" %%i in (`%vswherepath% -latest -property installationPath`) do (
import { disassembleByteCode } from '@neo-one/node-core'
import * as fs from "fs";
async function mainAsync() {
const PATH = String.raw`path\to\avm\file`
let avmByteCodes = await fs.promises.readFile(PATH);
const lines = disassembleByteCode(avmByteCodes)
for (const line of lines)
{
'use strict'
const { fetchPackage, getLatestVersion } = require('../nuget/nuget-v3-helpers')
const { renderVersionBadge } = require('../nuget/nuget-helpers')
const { BaseJsonService } = require('..')
const { NotFound } = require('..')
class AzureArtifactsNugetVersionService extends BaseJsonService {
static get category() {
return 'version'
@devhawk
devhawk / FNVHash.cs
Last active December 14, 2019 00:17
Lightweight implementation of 32 & 64 bit FNV Hash algorithms
using System;
namespace DevHawk
{
public class FNVHash
{
public const uint Prime32 = 16777619;
public const uint Offset32 = 2166136261;
public const ulong Prime64 = 1099511628211;
public const ulong Offset64 = 14695981039346656037;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Extensions.DependencyModel;
using Microsoft.Extensions.DependencyModel.Resolution;
namespace TestDependencyModel
{
class Program
{
"homepage": "https://iobureau.com/byenow/",
"version": "0.2",
"url": "https://iobureau.com/byenow/byenow-0.2.zip",
"architecture": {
"32bit": {
"bin": "32-bit/byenow.exe"
},
"64bit": {
"bin": "64-bit/byenow.exe"
@devhawk
devhawk / aProgram.cs
Last active February 29, 2020 00:20
DumpAvm
using System;
using System.Collections.Generic;
using System.IO;
namespace DumpAvm
{
readonly struct Instruction
{
public readonly AvmOpCodes OpCode;
public readonly ReadOnlyMemory<byte> Operand;
@devhawk
devhawk / keybase.md
Created April 21, 2020 22:22
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@devhawk
devhawk / winX-powershell-core.ps1
Created May 14, 2020 18:13
Update the start menu Windows PowerShell.lnk to point to PowerShell Core
$pwsh = get-command pwsh -ErrorAction SilentlyContinue
if (-not $pwsh) {
write-error "cannot locate pwsh, exiting"
break
}
$psLinkPath = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk"
$WshShell = New-Object -ComObject WScript.Shell
$psLink = $WshShell.CreateShortcut($psLinkPath)
Write-Output $psLink.TargetPath
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using Neo;
using Neo.Cryptography.ECC;