Skip to content

Instantly share code, notes, and snippets.

@enricosoft
enricosoft / OrleansDotNetSample
Created May 2, 2023 17:14
Microsoft Orleans.NET Sample
1) [ORLEANS.NET BACK-END]
// GRAIN (ACTOR) INTERFACE DEFINITION (ICartGrain.cs)
namespace GrainInterfaces
{
public interface ICartGrain : IGrainWithGuidKey
{
Task<Cart> GetCart();
@enricosoft
enricosoft / AkkaNetSample
Created May 2, 2023 17:09
Akka.NET Sample
namespace AkkaRoomReservationSample
{
class Program
{
static void Main(string[] args)
{
var system = ActorSystem.Create("MySystem");
IActorRef reservator = system.Actorof<ReservationActor>("reservator");
reservator.Tell (new BookThe Room { RoomNumber = "1"} );
reservator.Tell(new BookTheRoom { RoomNumber = "1" });
@JPRuskin
JPRuskin / README.md
Last active November 27, 2023 20:03
Remove old releases from a Nexus3-repository, originally from PhilSwiss/nexus-cleanup

Nexus Cleanup Logo

Nexus-Cleanup

Remove old releases from a Nexus3-repository

This Groovy-script will purge old versions (sorted by version-number) from a repository hosted on Nexus 3.x.

You can set the desired repository and a maximum amount of versions at the begining of this script.

@markjbrown
markjbrown / free-tier-arm-template-example
Last active January 30, 2024 20:11
Create a Cosmos DB free-tier account and database with 400 RU
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"databaseAccount_free_tier_name": {
"defaultValue": "my-cosmos-account-name",
"type": "String"
}
},
"variables": {},
@matzegebbe
matzegebbe / clean_docker_nexus.sh
Last active July 15, 2024 09:15
Nexus Repository Manager keep the last X docker images delete all other
#!/bin/bash
REPO_URL="https://repository.xxx.net/repository/"
USER="admin"
PASSWORD="datpassword"
BUCKET="portal-docker"
KEEP_IMAGES=10
IMAGES=$(curl --silent -X GET -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' -u ${USER}:${PASSWORD} "${REPO_URL}${BUCKET}/v2/_catalog" | jq .repositories | jq -r '.[]' )
@JimBobSquarePants
JimBobSquarePants / GifEncoder
Created October 16, 2014 22:29
An animated gif encoder in c#
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="GifEncoder.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// <summary>
// Encodes multiple images as an animated gif to a stream.
// <remarks>
// Always wire this up in a using block.
// Disposing the encoder will complete the file.
@cou929
cou929 / detect-private-browsing.js
Last active May 1, 2024 21:07
Detect private browsing mode (InPrivate Browsing or Incognito).
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);
@RubaXa
RubaXa / jquery.event.scroll.js
Last active December 17, 2015 06:58
jQuery extension, add support `scrollstart` and `scrollend` events.
/**
* jQuery extension, add support `scrollstart` and `scrollend` events.
*
* @author RubaXa <[email protected]>
* @github https://gist.github.com/RubaXa/5568964
* @license MIT
*
*
* @settings
* $.special.scrollend.delay = 300; // default ms
<html xmlns:fb="http://ogp.me/ns/fb#">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# oghowto: http://ogp.me/ns/fb/oghowto#">
<title>OG Tutorial App</title>
<meta property="fb:app_id" content="256521937796214" />
<meta property="og:type" content="oghowto:demo" />
<meta property="og:title" content="Open Graph HowTo" />
<meta property="og:image" content="http://placehold.it/200x200" />
<meta property="og:description" content="Minimum requirements to get Open Graph objects and actions working" />
<meta property="og:url" content="http://oghowto.herokuapp.com/test.html">
<style type="text/css">
@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.