Skip to content

Commit

Permalink
May 2020 (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
denisidoro authored May 24, 2020
1 parent 8b86719 commit a4986a0
Show file tree
Hide file tree
Showing 144 changed files with 2,334 additions and 898 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish

on:
push:
tags:
- '*'

jobs:

binary:
name: Publish binary for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# This should work with only the `include`s but it currently doesn't because of this bug:
# https://github.community/t5/How-to-use-Git-and-GitHub/GitHub-Actions-Matrix-options-dont-work-as-documented/td-p/29558
target: [x86_64-osx, x86_64-unknown-linux-musl, armv7-unknown-linux-musleabihf, armv7-linux-androideabi, aarch64-linux-android]
include:
- os: macos-latest
target: x86_64-osx
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
- os: ubuntu-latest
target: armv7-linux-androideabi
- os: ubuntu-latest
target: aarch64-linux-android

steps:
- uses: hecrj/[email protected]
with:
rust-version: stable
- uses: actions/checkout@v1
- name: Build
run: cd rust && bin/dot rust binary build --target ${{ matrix.target }}
- name: Tar
run: cd rust && bin/dot rust binary tar --target ${{ matrix.target }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: rust/target/tar/dotrs.tar.gz
tag: ${{ github.ref }}
asset_name: dotrs-${{ steps.get_version.outputs.VERSION }}-${{ matrix.target }}.tar.gz
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,16 @@ jobs:
uses: actions/setup-node@v1
- name: Run tests
run: ./bin/dot self test suite js

rust-tests:
name: Rust
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Setup cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run tests
run: ./bin/dot self test suite rust
1 change: 0 additions & 1 deletion bin/dot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ source "$DOTFILES/scripts/core/main.sh"
CALLING_DIR="${CALLING_DIR:-"$PWD"}"

##? A hub for an all-purpose set of scripts
#?? 1.0.0
##?
##? Usage:
##? dot
Expand Down
1 change: 0 additions & 1 deletion bin/dotn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -euo pipefail
export DOTFILES="${DOTFILES:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null && pwd)}"

##? A hub for an all-purpose set of scripts, using navi
#?? 0.1.0
##?
##? Usage:
##? dot <context> <cmd> [<args>...]
Expand Down
1 change: 0 additions & 1 deletion bin/git-dot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -euo pipefail
export dot_bin_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"

##? A hub for an all-purpose set of scripts, using navi
#?? 0.1.0
##?
##? Usage:
##? dot <context> <cmd> [<args>...]
Expand Down
2 changes: 1 addition & 1 deletion cheats/clojure.cheat
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Start a Clojure REPL using deps aliases
clj "-A:<alias>"

$ alias: cat "${HOME}/.clojure/deps.edn" | dot clojure data -o json | jq -r '.aliases | keys | .[]'
$ alias: cat "${HOME}/.clojure/deps.edn" | grep -A999 :aliases | grep -Ev ':extra-deps|:main-opts' | grep '^ :' | sed 's/^ *://g'
1 change: 0 additions & 1 deletion cheats/docker.cheat
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ docker network create <network_name>
$ image_id: docker images --- --headers 1 --column 3 --delimiter '\s\s+'
$ container_id: docker ps --- --headers 1 --column 1 --delimiter '\s\s+'


% docker-compose

# Builds, (re)creates, starts, and attaches to containers for all services
Expand Down
3 changes: 3 additions & 0 deletions cheats/git.cheat
Original file line number Diff line number Diff line change
Expand Up @@ -518,3 +518,6 @@ for branch in $(git branch -r --merged | egrep -v "origin/HEAD|origin/master");

# List ignored files
git status --ignored -s | grep "\!\!" | sed 's/!! //'

# Set master as parent, upstream branch
git branch -u master
9 changes: 8 additions & 1 deletion cheats/network.cheat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ lsof -i :<port> \
| awk '{l=$2} END {print l}' \
| xargs kill

# Kill a process for port
port="$(echo "<process>" | grep -Eo ':([0-9][0-9][0-9]+) ' | tr -d ':')"
lsof -i :$port \
| awk '{l=$2} END {print l}' \
| xargs kill

# List IP addresses connected on a given port
netstat -tn 2>/dev/null \
| grep :<port> \
Expand Down Expand Up @@ -43,4 +49,5 @@ sudo nmap -sS -sV -0 "<target>"
# Port owner
lsof -n -i4TCP:<port> | grep LISTEN

$ self_global_ip: dig +short myip.opendns.com @resolver1.opendns.com
$ self_global_ip: dig +short myip.opendns.com @resolver1.opendns.com
$ process: lsof -iTCP -sTCP:LISTEN -n -P | sed -E "s/:([0-9][0-9][0-9]+) /:$(tput setaf 3)\1$(tput sgr0) /g" --- --header-lines 1
58 changes: 42 additions & 16 deletions cheats/osx.cheat
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
% osx, macos
% osx, notification

# Display a notification with message, title and subtitle
osascript -e 'display notification "<message>" with title "<title>" subtitle "<subtitle>"'

# Display a notification with message and title
osascript -e 'display notification "<message>" with title "<title>"'

# Set DND on (silent)
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean true
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturbDate -date "$(date -u +\"%Y-%m-%d %H:%M:%S +000\")"
killall NotificationCenter

# Set DND off (not silent)
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean false
killall NotificationCenter


% osx, file

# Show desktop icons
defaults write com.apple.finder CreateDesktop -bool true && killall Finder

Expand All @@ -18,34 +30,48 @@ defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder
# Hide hidden files
defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder

# Lock screen
pmset displaysleepnow
# Create new file
suffix="$(date +'%Hh%Mmin%S')"; osascript -e 'set title to "new_'$suffix'.txt"' -e 'tell application "Finder" to make new file at (the target of the front window) as alias with properties {name: title}'

# Set dark mode on (dark)
osascript -e 'tell app "System Events" to tell appearance preferences to set dark mode to true'

# Set dark mode off (light)
osascript -e 'tell app "System Events" to tell appearance preferences to set dark mode to false'

# Set DND on
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean true
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturbDate -date "$(date -u +\"%Y-%m-%d %H:%M:%S +000\")"
killall NotificationCenter
% osx, power

# Set DND off
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean false
killall NotificationCenter
# Lock screen
pmset displaysleepnow

# Prevent sleep
caffeinate -t $((60*<minutes>))

# Prevent sleep for a long time
caffeinate -t 18000

# Turn Macbook display on :: screen
for i in $(seq 0 30); do osascript -e 'tell application "System Events"' -e 'key code 144' -e ' end tell'; done

# Turn Macbook display off :: screen
for i in $(seq 0 30); do osascript -e 'tell application "System Events"' -e 'key code 145' -e ' end tell'; done


% osx, wm

# Execute yabai command
eval "<yabai_cmd>"

$ yabai_cmd: dot system wm cheats navi --- --column 3 --delimiter '\s\s+'


% osx, ui

# Set dark mode on (dark)
osascript -e 'tell app "System Events" to tell appearance preferences to set dark mode to true'

# Set dark mode off (light)
osascript -e 'tell app "System Events" to tell appearance preferences to set dark mode to false'

# Set wallpaper for a single workspace
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "<wallpaper>"'

# Set wallpaper for multiple workspaces
osascript -e 'tell application "System Events" to tell every desktop to set picture to "<wallpaper>"'

$ wallpaper: find ~/Pictures/Wallpapers -type f
$ wallpaper: find ~/Pictures/Wallpapers -type f --- --preview 'viu --height 20 {}' --preview-window 'bottom:20'
14 changes: 7 additions & 7 deletions editors/spacevim/spacevim.rc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function! UserInit()
Plug 'junegunn/seoul256.vim'
Plug 'airblade/vim-rooter'
Plug 'danilo-augusto/vim-afterglow'
Plug 'liuchengxu/space-vim-dark'

endfunction

Expand All @@ -36,15 +37,14 @@ function! UserConfig()
" Use gui colors in terminal if available
if has('termguicolors')

colorscheme afterglow
" colorscheme afterglow
colorscheme space-vim-dark
hi Comment cterm=italic
hi Normal ctermbg=NONE guibg=NONE
hi LineNr ctermbg=NONE guibg=NONE
hi SignColumn ctermbg=NONE guibg=NONE
set termguicolors

if g:spacevim_tmux
" If use vim inside tmux, see https://github.com/vim/vim/issues/993
" set Vim-specific sequences for RGB colors
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
endif

endfunction
21 changes: 20 additions & 1 deletion editors/vscode/keybindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,24 @@
"key": "cmd+b",
"command": "editor.action.goToDeclaration",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "cmd+e",
"command": "-workbench.action.openRecent"
},
{
"key": "cmd+e",
"command": "extension.intellijRecentFiles",
"when": "!inQuickOpen"
},
{
"key": "cmd+e",
"command": "workbench.action.quickOpenNavigateNext",
"when": "inQuickOpen"
},
{
"key": "shift+cmd+e",
"command": "workbench.action.quickOpenNavigatePrevious",
"when": "inQuickOpen"
}
]
]
20 changes: 16 additions & 4 deletions editors/vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"window.zoomLevel": 0,
"window.zoomLevel": 1,
"editor.fontSize": 12,
"editor.letterSpacing": 0.2,
"editor.lineHeight": 18,
Expand Down Expand Up @@ -69,10 +69,17 @@
"**/.git": true,
"**/.DS_Store": true,
"**/node_modules": true,
"**/.gen": true,
"**/gen": true,
"/gen": true,
"**/.glue": true,
"**/.tmp": true,
"**/vendor": true,
"**/go-build": true,
"bazel-*": true,
"pkg*": true
},

"files.watcherExclude": {
"bazel-*": true,
"pkg*": true
Expand Down Expand Up @@ -130,6 +137,10 @@

"vim.normalModeKeyBindings": [

{"before": ["<leader>", "l", "e"],
"after": [],
"commands": [{"command": "workbench.action.tasks.runTask", "args": "Go transpile"}]},

{"before": ["<leader>", "<space>"],
"after": [],
"commands": [{"command": "workbench.action.showCommands", "args": []}]},
Expand Down Expand Up @@ -473,5 +484,6 @@
"commands": [{"command": "calva.evaluateCurrentTopLevelForm", "args": []}]}
],
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false
}
"explorer.confirmDelete": false,
"editor.wordWrap": "on"
}
11 changes: 11 additions & 0 deletions editors/vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Transpile",
"type": "shell",
"command": "/Users/denis.isidoro/dotfiles/bin/dot",
"args": ["code", "transpile", "${file}"]
}
]
}
47 changes: 0 additions & 47 deletions gaming/steam/rom_manager.json

This file was deleted.

Loading

0 comments on commit a4986a0

Please sign in to comment.