Skip to content

Instantly share code, notes, and snippets.


Lio李歐 lionello

View GitHub Profile
lionello / flake.nix
Created August 30, 2022 17:53
Generic flake.nix for migrating from shell.nix
View flake.nix
outputs = { self, nixpkgs, flake-utils }:
let pkgs = nixpkgs.legacyPackages.${system}; in
devShells.default = import ./shell.nix { inherit pkgs; };
lionello / post-merge
Created August 26, 2022 20:38 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
View post-merge
#!/usr/bin/env bash
# MIT © Sindre Sorhus -
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
lionello / writevt.c
Last active August 1, 2022 21:49
Forked writevt from console-tools
View writevt.c
* Mostly ripped off of console-tools' writevt.c
#include <stdio.h>
#include <fcntl.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <string.h>
lionello /
Created June 13, 2022 16:42 — forked from bgreenlee/
Automatic project versioning for Xcode using git commits & tags #xcode #git
# by Marc Hedlund
# Found at and slightly
# modified.
# To install:
lionello / translatekeycodes.swift
Created January 18, 2022 04:19 — forked from ArthurYidi/translatekeycodes.swift
virtual key codes to unicode characters
View translatekeycodes.swift
private static func keyCodeToString(keyCode: CGKeyCode, eventModifiers: Int) -> String? {
let curKeyboard = TISCopyCurrentKeyboardInputSource().takeRetainedValue()
let rawLayoutData = TISGetInputSourceProperty(curKeyboard, kTISPropertyUnicodeKeyLayoutData)
let layoutData = unsafeBitCast(rawLayoutData, to: CFData.self)
let keyboardLayoutPtr = unsafeBitCast(CFDataGetBytePtr(layoutData), to: UnsafePointer<UCKeyboardLayout>.self)
var deadKeyState: UInt32 = 0
var actualStringLength = 0
var unicodeString: [UniChar] = [0, 0, 0, 0]
View igloo.dxf
"DXF R12 Output" (
lionello / .emacs
Created March 28, 2021 15:34
My .emacs
View .emacs
(require 'package)
(add-to-list 'package-archives '("org" . ""))
(add-to-list 'package-archives '("melpa" . ""))
(add-to-list 'package-archives '("melpa-stable" . ""))
(setq package-enable-at-startup nil)
View Loan Project.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
lionello /
Last active July 7, 2021 06:24 — forked from blixt/
Playing SteamVR games on the Oculus Quest

Playing SteamVR games on the Oculus Quest, without owning a PC

Setting up your Virtual Machine

We'll be creating a new Virtual Machine on Microsoft's cloud platform, Azure. The VM will have a beefy GPU just like a home computer so it can be used for playing games.

  1. Go to [the Azure portal][azure] and sign up or log in.
  2. If you are on a Free account, first go to Subscriptions and upgrade it to a Pay-as-you-go plan. Don't worry, you will get to keep any free credits you have. Azure's interface is a bit slow so this will take a minute.

⚠️ Make sure to not include any support plan because they will charge you monthly!

# Avoid default fish path abbreviation
set -g -x fish_prompt_pwd_dir_length 0
# Use vim as default editor in fish
set -g -x EDITOR vim
# Force language of CLI tools to English (US)
set -g -x LANG en_US.UTF-8
#status --is-interactive; and source (rbenv init -|psub)