Skip to content

Instantly share code, notes, and snippets.

View lucamilan's full-sized avatar
🏠
Working from home

Luca Milan lucamilan

🏠
Working from home
View GitHub Profile
@timheuer
timheuer / devcontainer.json
Last active November 21, 2024 14:29
.NET 8 SDK devcontainer w/aspire
{
"name": ".NET with Aspire",
"image": "mcr.microsoft.com/dotnet/sdk:8.0",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "2"
},
"ghcr.io/devcontainers/features/powershell:1": {
"version": "latest"
@lucamilan
lucamilan / MinimalAPIs.md
Created May 17, 2023 06:15 — forked from davidfowl/MinimalAPIs.md
Minimal APIs at a glance
@davidfowl
davidfowl / MinimalAPIs.md
Last active June 8, 2026 14:54
Minimal APIs at a glance
@mrWeiss0
mrWeiss0 / resize.bat
Last active January 17, 2022 10:51
Converts and scales the files in a directory using ImageMagick
:: USAGE: ./resize.bat [OPTION]... [DIR]
::
:: Converts and scales the files in the directory DIR
:: If DIR is omitted it is asked to the user
:: Requires ImageMagick
::
:: /q Runs quietly
:: /n No action, print file names only
::
:: Parameters:
@curtisgibby
curtisgibby / svg-to-500px-png-with-padding.ps1
Last active January 17, 2022 10:48
Powershell script to use imagemagick to convert a directory of SVGs to PNGs (with 10% padding)
$svgs = Get-ChildItem (".\*") -Filter *.svg
$scriptPath = $MyInvocation.MyCommand.Path
$scriptDirectory = Split-Path $scriptPath
$outputDirectory = $scriptDirectory + "\output"
# Replace specific path as needed
$magickExePath = "C:\Program Files\ImageMagick-7.0.8-Q16\magick.exe"
ForEach($svg in $svgs) {
Write-Host $svg
@jermdavis
jermdavis / BasePipelineTypes.cs
Last active December 20, 2021 16:08
An example of strongly typed data pipelines, with some trivial examples
using System;
namespace StronglyTypedPipelines
{
/// <summary>
/// Base type for individual pipeline steps.
/// Descendants of this type map an input value to an output value.
/// The input and output types can differ.
/// </summary>
@krohne
krohne / javaStringToJavaScriptPrimitive.js
Created February 4, 2015 22:51
Convert Java String object to JavaScript String primitive in Rhino
// The good part:
// String(javaString).valueOf()
// Follow the same pattern to convert other Java types to corresponding JavaScript primitives
var javaString = new java.lang.String("test");
print('javaString:', javaString);
print('typeof javaString:', typeof javaString); // Object
print('javaString instanceof String:', (javaString instanceof String)); // true (really a java.lang.String object)
print('String(javaString).valueOf() === "test":', String(javaString).valueOf() === "test"); // true: Converted to JS primitive
@flcdrg
flcdrg / 1-boxstarter-bare-v4.ps1
Last active December 1, 2025 00:05
My BoxStarter Scripts
# 1. Install Chocolatey
<#
Set-ExecutionPolicy RemoteSigned -Force
# Create empty profile (so profile-integration scripts have something to append to)
if (-not (Test-Path $PROFILE)) {
$directory = [IO.Path]::GetDirectoryName($PROFILE)
if (-not (Test-Path $directory)) {
New-Item -ItemType Directory $directory | Out-Null
}
@lucamilan
lucamilan / jquery.fisheyegrid.js
Created September 13, 2012 10:46 — forked from a-laughlin/jquery.fisheyegrid.js
Fisheye Grid UI Design Pattern in jQuery
/*!
* jQuery Fisheye Grid version 0.01
* Copyright 2011, Adam Laughlin
* http://a-laughlin.com
* Licensed under MIT & GPL version 2
* http://static.a-laughlin.com/mit_license.txt
* http://static.a-laughlin.com/gpl_license.txt
*/
/*
@liammclennan
liammclennan / blog_backbone_app_framework.md
Created July 12, 2012 01:39
A Backbone Application Framework

Backbone is a library of tools that simplify the design and implementation of client-side web applications. It is explicitly not a framwework. Backbone does not provide guidance about how to assemble an application. This post will be an initial attempt at filling that gap. It assumes an intermediate level of Backbone.js knowledge. If you have never used Backbone.js try Backbone.js Basics or the Backbone.js homepage.

The Application Root

I like to provide a root object/namespace for my application. Let's call it app.

var app = {};

Register Components on the Application Object