Skip to content

Instantly share code, notes, and snippets.

View aalvarado's full-sized avatar

Adan Alvarado aalvarado

View GitHub Profile
@aalvarado
aalvarado / lsp_files.lua
Created November 4, 2025 02:35 — forked from arnm/lsp_files.lua
LSP-integrated file editing tools for CodeCompanion agents in Neovim (inspired by OpenCode)
---@diagnostic disable: undefined-field
-- write_file.lua --------------------------------------------------------------
---@class WriteFileToolArgs
---@field file_path string Absolute path of the file to write
---@field content string Content to write to the file
---@class EditFileToolArgs
---@field file_path string Absolute path of the file to edit
---@field old_string string The text to replace
@aalvarado
aalvarado / pg_change_db_owner.sh
Created September 29, 2015 18:03 — forked from jirutka/pg_change_db_owner.sh
Some convenient scripts to manage ownerships and privileges in PostgreSQL.
#!/bin/bash
#
# The MIT License
#
# Copyright 2014 Jakub Jirutka <[email protected]>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'arel'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
#/etc/udev/rules.d/99-displaymagic.rules
# enable LVDS on HDMI disconnect
SUBSYSTEM=="drm", ACTION=="change", RUN+="/usr/local/bin/displaymagic.sh"
before_filter :find_position, only: [:show, :destroy, :edit]
def destroy
if @position.destroy
flash[:success] = t('labels.success')
else
flash[:error] = t('labels.error')
end
redirect_to positions_path
end