Skip to content

Instantly share code, notes, and snippets.

View dangdennis's full-sized avatar

Dennis Dang dangdennis

View GitHub Profile
# Libxmlsec1 definition for 1.2.37. This includes the bottles for this version.
class Libxmlsec1 < Formula
desc "XML security library"
homepage "https://www.aleksey.com/xmlsec/"
url "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.37.tar.gz"
sha256 "5f8dfbcb6d1e56bddd0b5ec2e00a3d0ca5342a9f57c24dffde5c796b2be2871c"
license "MIT"
livecheck do
@dangdennis
dangdennis / unpin.sh
Last active July 8, 2023 19:29
Unpin all opam packages
#!/bin/bash
# Get the list of pinned packages
pinned_packages=$(opam list --pinned --short)
# Iterate through the list of pinned packages and unpin each one
for package in $pinned_packages; do
echo $package
opam unpin $package --yes
done
@dangdennis
dangdennis / Dockerfile
Created December 9, 2022 06:53
F# asp.net dockerfile
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
WORKDIR /app
# Copy source code and compile
COPY ./ ./
RUN dotnet restore
RUN dotnet publish --configuration Release -o bin
@dangdennis
dangdennis / .zshrc
Created June 30, 2022 19:36
M1 add binaries to path
# Store binaries here to <folder path>
export PATH=$PATH:<folder bath>
@dangdennis
dangdennis / sha1.js
Last active June 15, 2022 18:46
sha1 hash some files with Node
/**
* package.json
* { "type": "module" }
*/
import fs from 'fs/promises'
import path from 'path'
import { promisify } from 'util'
import { exec as cbExec } from 'child_process'
@dangdennis
dangdennis / get_cookie.server.ts
Created June 2, 2022 02:21
split a cookie string into their parts, and return selected key
@dangdennis
dangdennis / modal.tsx
Created May 17, 2022 22:23
Tailwind modal centered with wide buttons
/* This example requires Tailwind CSS v2.0+ */
import { Fragment, useRef, useState } from 'react'
import { Dialog, Transition } from '@headlessui/react'
import { CheckIcon } from '@heroicons/react/outline'
export default function Example() {
const [open, setOpen] = useState(true)
const cancelButtonRef = useRef(null)
/* This example requires Tailwind CSS v2.0+ */
import { Fragment, useState } from 'react'
import { Listbox, Transition } from '@headlessui/react'
import { CheckIcon, SelectorIcon } from '@heroicons/react/solid'
const people = [
{ id: 1, name: 'Wade Cooper' },
{ id: 2, name: 'Arlene Mccoy' },
{ id: 3, name: 'Devon Webb' },
{ id: 4, name: 'Tom Cook' },
@dangdennis
dangdennis / KmsSigner.ts
Last active October 21, 2024 20:19 — forked from miguelmota/KmsSigner.js
Typescripts ethers Signer using AWS KMS
// Code taken from https://gist.github.com/miguelmota/092da99bc8a8416ed7756c472dc253c4
import {
GetPublicKeyCommand,
KMSClient,
SignCommand,
} from "@aws-sdk/client-kms";
import { BigNumber, ethers, Signer, UnsignedTransaction } from "ethers";
import * as asn1 from "asn1.js";
import { AlchemyProvider } from "@ethersproject/providers";
@dangdennis
dangdennis / query-events.go
Last active May 4, 2021 03:18
Query Flow events concurrently
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/gin-gonic/gin"
"github.com/onflow/flow-go-sdk"