Skip to content

Instantly share code, notes, and snippets.

@StudioLE
StudioLE / install-ubuntu-on-ovh.md
Created October 2, 2024 21:57
install-ubuntu-on-ovh.md
  1. Boot into Rescue mode

https://www.ovh.com/manager/

  1. Download and run the Remote KVM Java Applet

  2. Power Control > Set Power Reset

If it doesn't boot into rescue mode you may need to press DEL to run setup and revise to boot order to make Network first.

@StudioLE
StudioLE / NaturalLanguageExtensions.cs
Last active September 5, 2022 11:22
Convert TimeSpan and DateTime to a natural language representations
/// <summary>
/// Convert a <see cref="TimeSpan"/> to a natural language representation.
/// </summary>
/// <example>
/// <code>
/// TimeSpan.FromSeconds(10).ToNaturalLanguage();
/// // 10 seconds
/// </code>
/// </example>
public static string ToNaturalLanguage(this TimeSpan @this)
@StudioLE
StudioLE / git-rewrite-tags-as-commits
Last active September 14, 2021 08:41
Git rewrite tags as commits. Squash everything but preserve tags.
#!/bin/bash
ORIGINAL_BRANCH="main"
NEW_BRANCH="new-history"
START_COMMIT="84eafe059aa3059d2e3db260a2248deae7502c57"
NEW_TAG_PREFIX="v2-"
git checkout -b ${NEW_BRANCH} ${START_COMMIT}
# Loop through every tag on the ORIGINAL_BRANCH
@StudioLE
StudioLE / dotnetlayout.md
Created July 29, 2021 11:46 — forked from davidfowl/dotnetlayout.md
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
git branch -m master main && git fetch origin && git branch -u origin/main main && git remote set-head origin -a
@StudioLE
StudioLE / git-renormalize.sh
Last active June 9, 2020 16:12
Renormalize all line endings
echo "* text=auto" >.gitattributes
git add --renormalize .
git commit -m "Renormalized end-of-line"
@StudioLE
StudioLE / 00-change-motd.sh
Last active June 4, 2020 09:58
Ubuntu Change Message of the Day (MOTD)
#!/bin/bash
# https://raymii.org/s/tutorials/Disable_dynamic_motd_and_motd_news_spam_on_Ubuntu_18.04.html
# Disable Dynamic MOTD
# Change ENABLED=1 to ENABLED=0.
sudo nano /etc/default/motd-news
# Disable a few components
sudo chmod -x /etc/update-motd.d/00-header
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configurations>Debug;Debug One;Release</Configurations>
</PropertyGroup>
<PropertyGroup>
<!-- Please remove the targets you don't need in order
to exclude Revit versions your add-in won't support
use the list below for matching Revit version with .NET target
2014 | net40
b = brick;
footprint = Rectangle.ByWidthLength(b.Width, b.Length);
surface = Surface.ByPatch(footprint);
base = surface.Thicken(6/5, false);
p1 = [Imperative]
{
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
test = IN[0]
true_list = IN[1]
false_list = IN[2]