Skip to content

Instantly share code, notes, and snippets.

View smolck's full-sized avatar

smolck

View GitHub Profile
@smolck
smolck / CMakeLists.txt
Created November 28, 2022 14:07
Just Skia stuff for future reference
cmake_minimum_required(VERSION 3.24) # MY MAJOR VERSION IS THE BEST VERSION
project(VacuumTerm
VERSION 0.1
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Completion is my friend
set(SKIA_DIR "${CMAKE_CURRENT_LIST_DIR}/third_party/skia")

With the above files in the same directory, on my system $ rustc day11.rs -C opt-level=3 && hyperfine -w 10 ./day11 results in:

Benchmark 1: ./day11
  Time (mean ± σ):      83.9 ms ±   5.4 ms    [User: 81.8 ms, System: 1.6 ms]
  Range (min … max):    77.4 ms …  93.0 ms    36 runs

from hyperfine.

$ odin build day11.odin -opt:3 && hyperfine -w 10 ./day11 with latest master at the time of writing this (commit https://github.com/odin-lang/Odin/commit/72862ce30d55891f1b04d3aadd085d7822f1b960) results in:

@smolck
smolck / blah.lua
Created August 26, 2021 19:27
......
return function()
vim.api.nvim_exec([[
echo luaeval("vim.fn.eval(\"'hi'\")")
]], false)
end
@smolck
smolck / main.dart
Created November 27, 2020 19:53
Loading fonts at runtime in Dart/Flutter
import 'dart:io';
import 'package:flutter/services.dart';
Future<ByteData> getFont() async {
var bytes = await File('${Platform.environment['HOME']}/.local/share/fonts/path/to/font}').readAsBytes();
return ByteData.sublistView(bytes);
}
void main() async {
var fontLoader = FontLoader('SomeFontFamily')..addFont(getFont());
@smolck
smolck / Counter.fs
Created May 30, 2020 15:09
Attempt at using FsHotReloading with Avalonia.FuncUI
namespace Dotnet
module Counter =
open Avalonia.Controls
open Avalonia.FuncUI.DSL
open Avalonia.Layout
type Msg =
| Increment
| Decrement
@smolck
smolck / neovim.nix
Created March 18, 2020 01:50
Nix and neovim with nodejs
self: prev:
let
neovim-unwrapped-master =
(prev.neovim-unwrapped.override {
lua = self.luajit;
}).overrideAttrs(oldAttrs: {
cmakeBuildType="debug";
cmakeFlags = oldAttrs.cmakeFlags ++ [ "-DMIN_LOG_LEVEL=0" ];
@smolck
smolck / remacs.nix
Created February 29, 2020 16:49
Not working Remacs derivation
{ stdenv, pkgs, fetchFromGitHub, ... }:
stdenv.mkDerivation {
name = "remacs";
version = "master";
buildInputs =
with pkgs;
let rust-nightly = pkgs.latest.rustChannels.nightly.rust; in
[
@smolck
smolck / index.html
Last active October 2, 2019 20:43 — forked from Sfshaza/index.html
todo
<!DOCTYPE html>
<!--
Copyright (c) 2012, the Dart project authors.
Please see the AUTHORS file for details.
All rights reserved. Use of this source code
is governed by a BSD-style license that can be
found in the LICENSE file.
-->