Skip to content

Instantly share code, notes, and snippets.

Avatar

smolck

View GitHub Profile
View blah.lua
return function()
vim.api.nvim_exec([[
echo luaeval("vim.fn.eval(\"'hi'\")")
]], false)
end
@smolck
smolck / main.dart
Created Nov 27, 2020
Loading fonts at runtime in Dart/Flutter
View main.dart
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
Attempt at using FsHotReloading with Avalonia.FuncUI
View Counter.fs
namespace Dotnet
module Counter =
open Avalonia.Controls
open Avalonia.FuncUI.DSL
open Avalonia.Layout
type Msg =
| Increment
| Decrement
@smolck
smolck / neovim.nix
Created Mar 18, 2020
Nix and neovim with nodejs
View neovim.nix
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 Feb 29, 2020
Not working Remacs derivation
View remacs.nix
{ stdenv, pkgs, fetchFromGitHub, ... }:
stdenv.mkDerivation {
name = "remacs";
version = "master";
buildInputs =
with pkgs;
let rust-nightly = pkgs.latest.rustChannels.nightly.rust; in
[
View index.html
<!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.
-->