function foo(a, b)
return a + b
end
def foo(a, b)
require("hs.ipc") | |
hs.hotkey.bind({'ctrl'}, "t", function() | |
app_name = hs.application.frontmostApplication():name() | |
if app_name == 'Alacritty' then | |
hs.osascript.applescript('tell application "Chrome" to activate') | |
else | |
hs.osascript.applescript('tell application "Alacritty" to activate') | |
end | |
end) |
require("hs.ipc") | |
--- ========================================== | |
--- Window Management | |
--- ========================================== | |
-- ctrl+option+left resizes window to left half of screen | |
hs.hotkey.bind({'ctrl', 'option'}, "Left", function() | |
local win = hs.window.focusedWindow() | |
local f = win:frame() | |
local screen = win:screen() |
set -o vi | |
# ===================== | |
# vi mode | |
# ===================== | |
bindkey -v | |
export KEYTIMEOUT=1 | |
# ===================== | |
# Change cursor shape for different vi modes. |
# ~/.oh-my-zsh/custom/themes/amirrajan.zsh-theme | |
# https://github.com/blinks zsh theme | |
function _prompt_char() { | |
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then | |
echo "%{%F{blue}%}±%{%f%k%b%}" | |
else | |
echo ' ' | |
fi | |
} |
# ~/.tmux.conf | |
# * brew install tmux reattach-to-user-namespace | |
# * C-e - Your leader <l> key. | |
# * <l>: - Type command not handled by shortcut keys. Eg: <l>: kill-pane ENT | |
# * <l>r - Reload this file/config. | |
# * <l>j - Select split using number jump list. | |
# * <l>{ - Swap splits left. | |
# * <l>} - Swap splits right. | |
# * <l>| - Create vertical split. | |
# * <l>- - Create orizontal split. |
class Game | |
attr_gtk | |
attr :enemy | |
def tick | |
defaults | |
calc | |
render | |
end |
class Game | |
attr_gtk | |
def defaults | |
state.player ||= { x: 640, | |
y: 360, | |
w: 80, | |
h: 80, | |
dx: 0, | |
dy: 0, |
def parse_input path | |
content = File.read path | |
list_1 = [] | |
list_2 = [] | |
content.each_line do |line| | |
l = line.strip.gsub(/\s+/, ' ').split(' ') | |
next if l.length != 2 | |
list_1 << l[0].to_i | |
list_2 << l[1].to_i | |
end |