# ~/.config/kitty/kitty.conf
map --when-focus-on title:claude shift+enter send_text all \n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # import config. | |
| # You can change the default config with `make cnf="config_special.env" build` | |
| cnf ?= config.env | |
| include $(cnf) | |
| export $(shell sed 's/=.*//' $(cnf)) | |
| # import deploy config | |
| # You can change the default deploy config with `make cnf="deploy_special.env" release` | |
| dpl ?= deploy.env | |
| include $(dpl) |
Teh Social Netswork!
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(10) NOT NULL
);
INSERT into users VALUES
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/config/initializers/paperclip.rb | |
| require 'paperclip/geometry_detector_factory' | |
| require 'paperclip/thumbnail' | |
| # HACK: Monkey patch to remove `[0]` from the end of filename. | |
| # Actual until https://github.com/thoughtbot/paperclip/issues/2223 | |
| # rubocop:disable all | |
| module Paperclip | |
| class GeometryDetector | |
| private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Fixnum | |
| LONG_MAX = ( (2 ** (64 - 2)) - 1 ) | |
| INT_MAX = ( (2 ** (32 - 2)) - 1 ) | |
| if LONG_MAX.class == Fixnum | |
| N_BYTES = 8 | |
| N_BITS = 64 | |
| MAX = LONG_MAX | |
| MIN = -MAX - 1 | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Description: This script spins up a multi node Docker Swarm w/ Docker | |
| # Networking and Consul discovery w/ Registrator | |
| # Author: Ryan C Koch | |
| # [email protected] | |
| # Usage: bash docker-playground.sh usage | |
| PLAYGROUND_NAME="docker-playground" | |
| CONSUL_IMAGE="progrium/consul" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ curl -H "Content-Type: application/json" -X POST -d '{"foo":"bar"}' http://localhost:2300/catch | |
| OK | |
| $ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pm - Print methods of objects in irb/console sessions. | |
| # Goes in ~./irbrc | |
| # | |
| begin # Utility methods | |
| def pm(obj, *options) # Print methods | |
| methods = obj.methods | |
| methods -= Object.methods unless options.include? :more | |
| filter = options.select {|opt| opt.kind_of? Regexp}.first | |
| methods = methods.select {|name| name =~ filter} if filter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| desc 'rolls back migrations in current branch not present in other' | |
| task :rollback_branch_migrations, [:other_branch] do |t, args| | |
| load "#{Dir.pwd}/Rakefile" | |
| branch_migrations = BranchMigrations.new(args.other_branch) | |
| puts ['Rollback the following migrations', branch_migrations, 'y,n? '] | |
| next if %w[no n NO N].include?(STDIN.gets.chomp) | |
| migrate_task = Rake::Task['db:migrate:down'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # Remove all gems EXCEPT defaults :) | |
| `gem list -d`.split(/\n\n^(?=\w)/).each do |data| | |
| match = data.match(/(?<name>([^\s]+)) \((?<versions>.*)\)/) | |
| name = match[:name] | |
| versions = match[:versions].split(', ') | |
| if match = data.match(/^.*\(([\d\.]*),? ?default\): .*$/) | |
| next if match[1].empty? # it's the only version if this match is empty |
NewerOlder