Skip to content

Instantly share code, notes, and snippets.

View dekart's full-sized avatar

Aleksey Dmitriev dekart

View GitHub Profile
@dekart
dekart / code-sanity-checker.md
Created February 19, 2026 11:01
Coding Agents

name: code-sanity-checker description: "Use this agent when you need to verify that recently written code is logically sound, efficient, and well-structured before it undergoes formal code review. This agent should be called after a logical chunk of code has been written (a completed feature, a refactored module, or a significant implementation) to catch architectural and logical issues early.\n\nExamples of when to use this agent:\n\n\nContext: The user has just finished implementing a new feature for player ratings in the Witchcraft game.\nuser: "I've implemented the player rating system. Here's the code:"\nassistant: "I'm going to use the Task tool to launch the code-sanity-checker agent to review the logic and structure of this implementation."\n\nSince a significant feature implementation was completed, use the code-sanity-checker agent to verify the logic is sound and the code is well-structured before formal review.\n\n\n\n\nCon

javascript:setTimeout(function(){
var m = window.location.href.match(/trello.com\/c\/[A-z\d]+\/(\d+)/);
if(m){
var text = new Date().toLocaleDateString("en-US") + "\t" +
'=HYPERLINK("'+m[0]+'","'+m[1]+'")' + "\t" +
document.querySelector('div.window-title>textarea').value;
navigator.clipboard.writeText(text);
@dekart
dekart / .gitignore
Created February 25, 2019 05:44
Unity Gitignore
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
Assets/AssetStoreTools*
# Visual Studio cache directory
.vs/
@dekart
dekart / README
Last active August 29, 2015 14:01
Iptables setup for port forwarding on local dev machine.
Should be added to /etc/network/if-pre-up.d/iptable_rules
Don't forget to run
chmod +x /etc/network/if-pre-up.d/iptable_rules
class Object
def self.my_decorator(method_name)
alias_method "#{method_name}_without_my_decorator", method_name
define_method method_name do
puts "My decorator logic starts"
result = send("#{method_name}_without_my_decorator")
puts "My decorator logic ends"
result
end
@dekart
dekart / convert_to_webp
Created August 9, 2013 09:18
A script to convert JPEG and PNG images in desired folders to WebP
#!/usr/bin/env ruby
def process_folders(message, *folders, &block)
root = File.expand_path('../..', __FILE__)
puts message
puts
total_old = 0
total_new = 0
ffmpeg -i input.mkv -map 0:0 -map 0:2 -c:v copy -c:a:0 copy output.mp4
CLAN_ID = 1
clan = Clan.find(CLAN_ID)
character_ids = ClanMember.connection.select_values(
ClanMember.send(:sanitize_sql, ["SELECT character_id FROM clan_members WHERE clan_id = :clan", :clan => clan.id])
)
position = 0
@dekart
dekart / backup.rb
Created May 28, 2013 09:02
Redis backup & restore script
def backup(path, redis)
keys = redis.keys
puts "#{ keys.size } keys to dump"
File.open(path, 'w+') do |f|
keys.each_with_index do |key, i|
next unless dump = redis.dump(key)
f.puts JSON.dump([key, dump.force_encoding('utf-8')]).force_encoding('utf-8')
[mysql]
# CLIENT #
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
# GENERAL #
user = mysql