A proof of concept of having Sinatra like routes inside your controllers.
Since the router is gone, feel free to remove config/routes.rb
.
Then add the file below to lib/action_controller/inline_routes.rb
inside your app.
#!/usr/bin/env zsh | |
function usage() { | |
cat <<EOF | |
USAGE i3-xephyr start|stop|restart|run | |
start Start nested i3 in xephyr | |
stop Stop xephyr | |
restart reload i3 in xephyr | |
run run command in nested i3 | |
EOF |
# Just add the following lines to your i3 config file | |
# dynamic tagging feature | |
bindsym $mod+t exec ~/.i3/get_workspace_options.py | dmenu -b | ~/.i3/go_to_workspace.py | |
bindsym $mod+Shift+t exec ~/.i3/get_workspace_options.py | dmenu -b | ~/.i3/move_to_workspace.py |
require "socket" | |
require "uri" | |
url = URI.parse(ARGV.first || abort("Usage: node_dos.rb <url>")) | |
sock = TCPSocket.new(url.host, url.port) | |
loop do | |
sock.write "GET / HTTP/1.1\r\n\r\n" | |
end |
#!/bin/bash | |
SINK="`pactl info | grep -P '^Default Sink: ' | sed 's/[^:]\+:\s\+//'`" | |
[[ -z "$SINK" ]] && exit 1 | |
if [[ "$SINK" =~ DragonFly ]]; then | |
INCR='24' | |
MIN_VOLUME=65050 | |
MAX_VOLUME=65146 | |
else | |
INCR='2%' |
# Enviroment setup | |
# Path vars | |
set -gx PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin | |
set -gx PATH /opt/homebrew/bin $PATH | |
set -gx PATH $PATH $HOME/.local/bin | |
set -gx PATH $PATH $HOME/.cargo/bin | |
set -gx PATH $PATH $HOME/.yarn/bin |
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
[ | |
{ "keys": ["alt+;"], "command": "run_macro_file", "args": {"file": "Packages/User/Semicolon EOL.sublime-macro"} }, | |
{ "keys": ["alt+["], "command": "run_macro_file", "args": {"file": "Packages/User/{} EOL.sublime-macro"} }, | |
{ "keys": ["alt+,"], "command": "run_macro_file", "args": {"file": "Packages/User/Colon EOL.sublime-macro"} }, | |
{ "keys": ["alt+end"], "command": "move_to", "args": {"to": "bol", "extend": false} }, | |
{ "keys": ["ctrl+r"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} }, | |
{ "keys": ["super+;"], "command": "show_overlay", "args": {"overlay": "goto", "text": "#"} }, | |
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol", "extend": false} }, | |
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol", "extend": false} }, | |
{ "keys": ["ctrl+home"], "command": "move_to", "args": {"to": "bof", "extend": false} }, |
# Useful aliases {{{ | |
alias c 'clear' | |
alias hl 'less -R' | |
alias paththis 'set PATH (pwd) $PATH' | |
alias ef 'vim ~/.config/fish/config.fish' | |
# }}} | |
# Environment variables {{{ |
#!/bin/bash -ex | |
# Paste this into ssh | |
# curl -sL https://gist.github.com/andsens/2913223/raw/bootstrap_homeshick.sh | tar -xzO | /bin/bash -ex | |
# When forking, you can get the URL from the raw (<>) button. | |
### Set some command variables depending on whether we are root or not ### | |
# This assumes you use a debian derivate, replace with yum, pacman etc. | |
aptget='sudo apt-get' | |
chsh='sudo chsh' |