Skip to content

Instantly share code, notes, and snippets.

@rubenmoya
rubenmoya / .vimrc
Created February 6, 2018 21:21
My .vimrc
" Remember to install Plug first
" (https://github.com/junegunn/vim-plug#installation), start up vim and type
" :PlugInstall to get the plugins installed.
syn on
set number
set noswapfile
set nowrap
set cursorline
@rubenmoya
rubenmoya / wadus.sh
Last active February 11, 2018 09:50
tmux script
# Set a variable with the session name
SESSION=wadus
# Create our new session, detached so that the rest of the script can run
tmux new-session -d -s $SESSION
# Rename first window to frontend
tmux rename-window -t $SESSION:0 'frontend'
# Start editor
@rubenmoya
rubenmoya / .tmux.conf
Created February 11, 2018 10:04
My .tmux.conf
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# History option
@rubenmoya
rubenmoya / index.html
Last active June 6, 2018 18:00
Hackarto.vl
<!DOCTYPE html>
<html>
<head>
<title>Spanish Congress Elections · Hackarto.VL</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<!-- Include CARTO VL JS -->
<script src="https://libs.cartocdn.com/carto-vl/v0.5.0-beta/carto-vl.js"></script>
<!-- Include Mapbox GL JS -->
@rubenmoya
rubenmoya / middleware.rb
Created April 22, 2019 14:41
Rails middleware to convert request params and response data from camelCase to snake_case
module CaseConverter
class Transformations
class << self
def transform(value)
case value
when Array then value.map { |item| transform(item) }
when Hash then value.deep_transform_keys! { |key| transform(key) }
when String then camelize(value)
else value
end
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $upstream_addr '
'"$http_referer" "$http_user_agent"';
# Redirect 80 to 443
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}