Skip to content

Instantly share code, notes, and snippets.

View lucamilan's full-sized avatar
:bowtie:
I may be slow to respond.

Luca Milan lucamilan

:bowtie:
I may be slow to respond.
View GitHub Profile
@timheuer
timheuer / devcontainer.json
Last active July 3, 2024 20: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 28, 2024 17:42
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:
# A BoxStarter script for use with http://boxstarter.org/WebLauncher
# Updates a Windows machine and installs a range of developer tools
# Show more info for files in Explorer
Set-WindowsExplorerOptions -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
# Enable remote desktop
Enable-RemoteDesktop
# Small taskbar
@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 / boxstarter-bare-v3.ps1
Last active March 25, 2024 01:47
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
*/
/*