Skip to content

Instantly share code, notes, and snippets.

View lionello's full-sized avatar
🇭🇰

Lio李歐 lionello

🇭🇰
View GitHub Profile
@lionello
lionello / .emacs
Created March 28, 2021 15:34
My .emacs
(require 'package)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
(setq package-enable-at-startup nil)
(package-initialize)
(custom-set-variables
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lionello
lionello / OculusQuestCloudGaming.md
Last active July 7, 2021 06:24 — forked from blixt/OculusQuestCloudGaming.md
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)
@lionello
lionello / Visual Studio copy.xml
Created August 5, 2019 06:32
IntelliJ AndroidStudio Keymap
<keymap version="1" name="Visual Studio copy" parent="Visual Studio">
<action id="$Copy">
<keyboard-shortcut first-keystroke="ctrl c" />
<keyboard-shortcut first-keystroke="meta c" />
</action>
<action id="$Cut">
<keyboard-shortcut first-keystroke="ctrl x" />
<keyboard-shortcut first-keystroke="shift delete" />
<keyboard-shortcut first-keystroke="meta x" />
</action>
@lionello
lionello / settings.json
Last active August 5, 2019 12:46
VSCode user settings JSON
{
"telemetry.enableTelemetry": false,
"window.openFilesInNewWindow": "off",
"go.useLanguageServer": true,
"terminal.integrated.shell.windows": "/Users/llunesu/.nix-profile/bin/fish",
"workbench.colorTheme": "Dark (Monokai)",
"editor.rulers": [
0, 80, 120
],
"files.trimTrailingWhitespace": true,
{
/* put this file in ~/Library/KeyBindings/ */
/* Home */
"\UF729" = "moveToBeginningOfLine:";
"^\UF729" = "moveToBeginningOfDocument:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
"^$\UF729" = "moveToBeginningOfDocumentAndModifySelection:";
/* End */
@lionello
lionello / graph.py
Last active June 14, 2019 01:44
Utility to generate plantuml diagram for Fortran project
#!/usr/bin/env python3
import itertools
import sys
import re
import os
from collections import defaultdict
MODULE = re.compile(r'^(END )?MODULE\s+([A-Z0-9_]+)', re.IGNORECASE)
USE = re.compile(r'^USE\s+([A-Z0-9_]+)(\s*,\s*ONLY\s*:\s*([A-Z0-9_,]+))?', re.IGNORECASE)
BEGIN = re.compile(r'^(SUBROUTINE|PROGRAM|((COMPLEX|LOGICAL|INTEGER|REAL|CHARACTER)(\([^)]+\))? )?FUNCTION)\s+([A-Z0-9_]+)', re.IGNORECASE)
if [ "$(uname -s)" != "Linux" ] && [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
source ~/.profile
PATH=/usr/local/sbin:$PATH
function __smile() { if [ $? -ne 0 ]; then echo ":("; else echo ":)"; fi }
GIT_PS1_SHOWDIRTYSTATE=true
PS1="\n\$(__smile)\[\e[1m\]\w\[\e[0m\]\$(__git_ps1)\n\$ "
@lionello
lionello / stashd.d
Last active August 7, 2022 18:32
Tool to find GIT stashes containing changes to specified file(s)
#!/usr/bin/env rdmd
// Get rdmd from https://dlang.org/download.html (or brew, nix, apt, yum)
// Copyright Lionello Lunesu. Placed in the public Domain.
// https://gist.github.com/lionello/84cad70f835131198fee4ab7e7592fce
import std.stdio : writeln;
int main(string[] args) {
import std.process : pipeProcess, wait, Redirect;