Skip to content

Instantly share code, notes, and snippets.

View alexanderbluhm's full-sized avatar

Alexander Bluhm alexanderbluhm

View GitHub Profile
@alexanderbluhm
alexanderbluhm / upload-step.js
Created April 17, 2023 09:23
proud code sample
const upload = async (e) => {
e.preventDefault();
setLoading(true)
// ...
try {
const [res] = await Promise.allSettled([
fetch(`${process.env.REACT_APP_API_URL}/upload`, {
method: "POST",
body: data,
credentials: "include",
@alexanderbluhm
alexanderbluhm / testimonial.js
Created June 3, 2020 14:06
TailwindCSS - Minimalistic Testimonial
export const Testimonial = () => (
<div className="grid grid-cols-1 gap-4 md:grid-cols-3">
<div>
<img
className="mx-auto h-12 w-12 object-cover rounded-full"
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80"
alt="John"
/>
<div className="pt-2 pb-4 px-4 -mt-6 flex flex-col justify-between bg-gray-50 rounded-md space-y-2">
<div className="mt-6 space-y-2 text-center">
@alexanderbluhm
alexanderbluhm / BinaryConverter.cs
Created December 10, 2019 13:29
Convertion between byte array and object
using System;
using System.Runtime.InteropServices;
namespace Utility
{
/*
*
struct Recipe
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 100)] // important to define the string length
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AmazonReportTool.Core.Helper
{