Skip to content

Instantly share code, notes, and snippets.

View copernicus365's full-sized avatar

Nicholas Petersen copernicus365

  • Huber Heights, Ohio
View GitHub Profile
@VincentH-Net
VincentH-Net / Extensions.cs
Created April 9, 2024 18:03
ASP.NET Core Minimal API's Endpoints registration helper
// Endpoints registration helper
// Enables DI for a group of endpoints to reduce init code and repeating parameters across endpoints
// Usage in e.g. Program.cs:
app.RegisterEndpoints(
typeof(CatalogEndpoints),
typeof(BasketsEndpoints)
);

FileSync

A cross-platform command-line file-syncer, which can sync files from a local source directory, with glob filters, and backup to either another directory, or to cloud storage, namely to Azure blob storage. (Though stalled, it should be trivial in the future to expanded this to Amazon S3 and hopefully even to FTP)

Many years prior I named this tool FileUp.

dotnet tool

Currently the source for this tool is not released. Till then however this gist / readme provides needed documentation.

{
"defaultProfile": "{79285a8e-036c-446f-8a9c-78994e34bf85}",
"initialRows": 30,
"initialCols": 120,
"alwaysShowTabs": true,
"showTerminalTitleInTitlebar": true,
"showTabsInTitlebar": true,
"requestedTheme": "dark",
"profiles": [
{
@copernicus365
copernicus365 / emoji-full-codes-csv-printout.csv
Created March 14, 2018 13:49
A comma-separated list of emoji values, containing 1) the emoji value itself (`char.ConvertFromUtf32(theDecimalNum)`), 2) its hex value representation, 3) its decimal / integer representation, and 4) the name. The code I wrote to generate this started by parsing the map contained here: https://github.com/ellekasai/twemoji-awesome/blob/gh-pages/v…
😄 1f604 128516 smile
😆 1f606 128518 laughing
😊 1f60a 128522 blush
😃 1f603 128515 smiley
263a 9786 relaxed
😏 1f60f 128527 smirk
😍 1f60d 128525 heart-eyes
😘 1f618 128536 kissing-heart
😚 1f61a 128538 kissing-closed-eyes
😳 1f633 128563 flushed
@greencoder
greencoder / apns.sh
Created May 11, 2016 17:04
Curl the APNS http/2 API
# Note: You MUST have curl 7.47+ with http/2 support compiled in
curl -v \
-d '{"aps":{"alert":"<message>","badge":42}}' \
-H "apns-topic: <bundle id>" \
-H "apns-priority: 10" \
--http2 \
--cert <certificate file> \
https://api.development.push.apple.com/3/device/<device token>
@DanDiplo
DanDiplo / JS-LINQ.js
Last active April 29, 2024 10:30
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@niik
niik / CryptoRandom.cs
Created June 9, 2011 21:48
Buffered CryptoRandom implementation based on Stephen Toub and Shawn Farkas' CryptoRandom
/*
* Original version by Stephen Toub and Shawn Farkas.
* Random pool and thread safety added by Markus Olsson (freakcode.com).
*
* Original source: http://msdn.microsoft.com/en-us/magazine/cc163367.aspx
*
* Some benchmarks (2009-03-18):
*
* Results produced by calling Next() 1 000 000 times on my machine (dual core 3Ghz)
*