Skip to content

Instantly share code, notes, and snippets.

Avatar

Frank A. Krueger praeclarum

View GitHub Profile
@praeclarum
praeclarum / Info.plist
Created Oct 18, 2020
Plist for QL thumbnails
View Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>iCircuit Thumbnails</string>
<key>CFBundleName</key>
<string>CircuitThumbs</string>
<key>CFBundleIdentifier</key>
<string>com.kruegersystems.circuit.thumbs</string>
@praeclarum
praeclarum / Migrations.cs
Created Aug 30, 2020
Database migrations using Dapper
View Migrations.cs
using System;
using System.Linq;
using Microsoft.Extensions.Logging;
using Dapper;
namespace Data
{
public class Migrations
{
private readonly Database database;
View gist:75e217e58ee891ca5373a478c8c56f05
var a = 10;
var b = 200;
Console.WriteLine((a > b) ? a : b);
Console.WriteLine((a > b) ? b : a);
Console.WriteLine(Math.Max(a, b));
Console.WriteLine(Math.Min(a, b));
@praeclarum
praeclarum / DataGridView.swift
Created Jun 28, 2020
Data Grid SwiftUI using LazyVGrid
View DataGridView.swift
//
// DataGridView.swift
// Predictor
//
// Created by Frank A. Krueger on 6/25/20.
//
import SwiftUI
struct Column: Identifiable {
@praeclarum
praeclarum / MeadowEnclosure.js
Created May 22, 2020
OpenJSCAD source code for the Meadow Enclosure shown at the Wilderness Labs Dev Camp
View MeadowEnclosure.js
var resolution = 50;
var printerError = 0.05;
var xsize = 100;
var ysize = 100;
var height = 20;
@praeclarum
praeclarum / build.sh
Created Apr 12, 2020
Ooui.Wasm.Test build script
View build.sh
#!/bin/bash
msbuild ../Ooui.Wasm.Build.Tasks/Ooui.Wasm.Build.Tasks.csproj && cp ../Ooui.Wasm.Build.Tasks/bin/Debug/netstandard2.0/Ooui.Wasm.Build.Tasks.dll ./ && msbuild /t:Restore && msbuild Ooui.Wasm.Test.csproj
@praeclarum
praeclarum / Dark Continuous.json
Created Mar 6, 2019
A dark and vibrant color theme for Visual Studio for Mac
View Dark Continuous.json
{
"name": "Dark Continuous",
"version": "1.0",
"description": "Dark and Vibrant from Continuous for the iPad",
"originator": "Frank A. Krueger",
"palette": [
{ "name": "cont-white", "value": "#F2F2F8" },
{ "name": "cont-selection", "value": "#4B5566" },
{ "name": "cont-background", "value": "#282A2E" },
@praeclarum
praeclarum / PlaidMLFailsDDPG.log
Created Jul 31, 2018
Error from PlaidML when running DDPG
View PlaidMLFailsDDPG.log
$ python ddpg_pendulum.py
/Users/fak/.virtualenvs/control/lib/python2.7/site-packages/gym/__init__.py:15: UserWarning: gym.undo_logger_setup is deprecated. gym no longer modifies the global logging configuration
warnings.warn("gym.undo_logger_setup is deprecated. gym no longer modifies the global logging configuration")
WARN: gym.spaces.Box autodetected dtype as <type 'numpy.float32'>. Please provide explicit dtype.
WARN: gym.spaces.Box autodetected dtype as <type 'numpy.float32'>. Please provide explicit dtype.
INFO:plaidml:Opening device "opencl_amd_amd_radeon_pro_vega_56_compute_engine.0"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
flatten_1 (Flatten) (None, 3) 0
@praeclarum
praeclarum / CSharpPredictor.fs
Created Jul 19, 2018
Predicts then next C# tokens given a history of previous tokens using CoreML on iOS with F#
View CSharpPredictor.fs
// Given previous tokens, predict the next token (and runners up)
let predictNextToken (previousKinds : SyntaxKind[]) : Prediction[] =
if ios11 then
let model : MLModel = model.Value // Load the cached model
let mutable predictions : Prediction[] = [| |]
// RNNs require external memory
let mutable lstm_1_h : MLMultiArray = null
let mutable lstm_1_c : MLMultiArray = null
@praeclarum
praeclarum / CSharpFormatter.fs
Created Apr 12, 2018
Formats C# code using roslyn syntax and semantics
View CSharpFormatter.fs
let getRefInfo (x : SyntaxNode) (ident : SyntaxToken) (isO : bool) =
let si = semantics.GetSymbolInfo (x)
if si.Symbol <> null then
Some (ident, si.Symbol, true, isO)
else None
let getDefInfo (x : SyntaxNode) (ident : SyntaxToken) (isO : bool) =
let s = semantics.GetDeclaredSymbol (x)
if s <> null then
Some (ident, s, false, isO)
You can’t perform that action at this time.