Skip to content

Instantly share code, notes, and snippets.

@pearswj
pearswj / .block
Last active March 14, 2021 12:00
Rhino + Draco round-tripping
license: mit
@pearswj
pearswj / Program.cs
Created February 10, 2021 16:16
A simple dotnet console app to hammer a Rhino Compute server
using Rhino.Compute;
using System;
using System.Threading.Tasks;
namespace hammertime
{
class Program
{
static void Main(string[] args)
{
@pearswj
pearswj / Program.cs
Created February 9, 2021 23:04
.NET process affinity test
using System;
using System.Diagnostics;
using System.Threading;
namespace procaff
{
class Program
{
static void Main(string[] args)
{
@pearswj
pearswj / Dockerfile
Created February 5, 2021 13:25
Windows docker image for filebeat based on nano server
# escape=`
# https://key4coding.com/2020/04/windows-nanoserver-issues-quick-fix/
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as Servercore
FROM mcr.microsoft.com/windows/nanoserver:1809
COPY --from=Servercore /windows/system32/netapi32.dll /windows/system32/
USER ContainerAdministrator
# download and unzip before building
using System;
using System.Collections;
using System.Collections.Generic;
using Rhino;
using Rhino.Geometry;
using Grasshopper;
using Grasshopper.Kernel;
using Grasshopper.Kernel.Data;
@pearswj
pearswj / Program.cs
Created August 28, 2020 15:39 — forked from DanielSWolf/Program.cs
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@pearswj
pearswj / setup.sh
Last active June 1, 2020 10:00
Toolchain for building rhino3dm on Amazon Linux 2
# https://docs.microsoft.com/en-gb/dotnet/core/install/linux-package-manager-centos7
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
sudo yum install -y dotnet-sdk-2.2 cmake3 gcc-c++ git
# symlink cmake3 to ~/bin/cmake (on $PATH)
mkdir -p ~/bin && ln -s $(which cmake3) ~/bin/cmake
git clone --recursive https://github.com/mcneel/rhino3dm.git
@pearswj
pearswj / clean.sh
Last active January 21, 2021 13:01
#!/usr/bin/env bash
set -e
for dir in pull_request2_*
do
echo -e "\n----> Cleaning $dir\n"
pushd $dir
#!/usr/bin/env python
# Reformat c++ documentation comments from docjet (also supported by
# doc-o-matic) to c#-style xml (supported by doxygen).
#
# Configure doxygen filter like so...
#
# FILTER_PATTERNS = *.h="python docjet2xml.py"
#
#
@pearswj
pearswj / index.html
Last active June 3, 2018 01:17
Web page listing latest CI builds for SpeckleRhino
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="centered">
<h1>SpeckleRhino</h1>
</div>