Skip to content

Instantly share code, notes, and snippets.

🇭🇰

Lio李欧 lionello

🇭🇰
Block or report user

Report or block lionello

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View config.fish
# 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 Aug 5, 2019
IntelliJ AndroidStudio Keymap
View Visual Studio copy.xml
<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 Aug 5, 2019
VSCode user settings JSON
View 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,
View DefaultKeyBinding.dict
{
/* put this file in ~/Library/KeyBindings/ */
/* Home */
"\UF729" = "moveToBeginningOfLine:";
"^\UF729" = "moveToBeginningOfDocument:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
"^$\UF729" = "moveToBeginningOfDocumentAndModifySelection:";
/* End */
@lionello
lionello / graph.py
Last active Jun 14, 2019
Utility to generate plantuml diagram for Fortran project
View graph.py
#!/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)
View .bash_profile
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 Jun 20, 2019
Tool to find GIT stashes containing changes to specified file(s)
View stashd.d
#!/usr/bin/env rdmd
// Copyright Lionello Lunesu. Placed in the public Domain.
// https://gist.github.com/lionello/84cad70f835131198fee4ab7e7592fce
import std.string : indexOf;
@nogc @safe pure nothrow
private bool anyMatch(in char[][] names, in char[] line) {
foreach (name; names) {
if (line.indexOf(name) >= 0) {
@lionello
lionello / fish_prompt.fish
Created Feb 28, 2019
My FISH prompt (avoids shortened path names, unless too long or in subshells)
View fish_prompt.fish
# Defined in /var/folders/ml/_hzb5l216p31wb_x6c58nfb80000gn/T//fish.ux0PG0/fish_prompt.fish @ line 2
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
set -l normal (set_color normal)
# Hack; fish_config only copies the fish_prompt function (see #736)
if not set -q -g __fish_classic_git_functions_defined
set -g __fish_classic_git_functions_defined
function __fish_repaint_user --on-variable fish_color_user --description "Event handler, repaint when fish_color_user changes"
View Coul_Buck.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lionello
lionello / mknix.sh
Created Nov 26, 2018
Little bash script to generate shell.nix default.nix
View mknix.sh
#!/usr/bin/env bash
usage () {
echo "Usage: $(basename $0) [--direnv] [--shell] [--default] -p|--packages packages... [--test]"
exit 0
}
error () {
echo "Error: $1"
exit 1
You can’t perform that action at this time.