Skip to content

Instantly share code, notes, and snippets.

View filipebraida's full-sized avatar

Filipe Braida filipebraida

View GitHub Profile
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Set up the prompt
autoload -Uz promptinit
@filipebraida
filipebraida / .zshrc
Created July 21, 2020 21:39
ZSHRC Config File
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/filipebraida/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@filipebraida
filipebraida / script.sh
Created June 29, 2020 14:49
Create Empty Orphan Branch for Code Review
# review branch
git checkout --orphan review
## remove under the git
git ls-files | xargs git rm --cached
## remove files
git clean -fxd
# create start point
git commit --allow-empty -m "Start of the review"
# create empty branch
git branch empty
@filipebraida
filipebraida / cloudSettings
Last active March 6, 2022 15:31
VSCode Preferences
{"lastUpload":"2022-03-06T15:31:42.336Z","extensionVersion":"v3.4.3"}
@filipebraida
filipebraida / keybindings.json
Created January 8, 2020 18:26
VSCode Shortcuts
// Place your key bindings in this file to override the defaults
[
// Toggle between terminal and editor focus
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",
[user]
email =
name =
[alias]
pom = push origin master -u
ps = push
ci = commit
co = checkout
cm = checkout master
function multiply(a::Array{T, 2}, b::Array{T, 2}) where T <: Number
if size(a, 2) != size(b, 1)
error("size")
end
c = Array{T}(undef, size(a, 1), size(b, 2))
for i = 1:size(a, 1), j = 1:size(b, 2)
aux = 0.0
for k = 1:size(a, 2)

Automatic keyboard/input source switching for OSX

brew install jeantil/autokbisw/autokbisw
brew services start jeantil/autokbisw/autokbisw
@filipebraida
filipebraida / k780.md
Created September 6, 2019 13:56 — forked from andrejcremoznik/k780.md
Logitech K780 switch media and function keys on linux

Media/function keys on K780

K780 doesn't have a hard switch to lock the function keys. Logitech provides a utility to do this on Windows and iOS but not on Linux. You need to manually remap the keys.

Below works for Arch Linux, other systemd based distros should be about the same.

There's a problem with the F1-F3 keys as they're hardware specific and don't emit an event if pressed on their own and therefore can't be remapped. I might be wrong as I haven't spend any time on researching that.

Create file /usr/lib/udev/hwdb.d/95-k780.hwdb

#To make GPU invisible
export CUDA_VISIBLE_DEVICES=""
#To return to normal
unset CUDA_VISIBLE_DEVICES