Skip to content

Instantly share code, notes, and snippets.

View semanticart's full-sized avatar

Jeffrey Chupp semanticart

View GitHub Profile
-- /Users/ship/.config/nvim/after/ftplugin/text.lua
vim.lsp.start {
name = "LSP From Scratch",
cmd = {
"npx", "ts-node",
-- Update this with the path to your server.ts
vim.fn.expand("~/src/lsp-from-scratch/server/src/server.ts")
},
capabilities = vim.lsp.protocol.make_client_capabilities()
@semanticart
semanticart / reload-chrome
Created January 8, 2024 15:19
reload chrome
#!/usr/bin/osascript
tell application "Google Chrome"
set i to (count of windows)
repeat while i > -1
set theWindow to window i
set t to (title of (window i))
#!/usr/bin/env bash
if [[ $# -eq 0 ]] ; then
echo 'You must provide a size'
exit 0
fi
# first make the image with no content
convert -size $1 xc:hotpink $1.png
# now add in the size
require 'formula'
class Wkhtmltopdf < Formula
url 'http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9.tar.bz2'
homepage 'http://code.google.com/p/wkhtmltopdf/'
# md5 'df2bb84b7d15140ca14732898155dd6a'
sha1 '41f598c0103326e7c13101391447b0284b4ba3cb'
depends_on 'qt'
@semanticart
semanticart / template_method.rb
Created September 12, 2013 19:56
quick & dirty hack at implementing template method / abstracts / insanity
module TemplateMethod
module TemplateInitializer
def initialize(*args)
unimplemented = self.class::TEMPLATE_METHODS.select do |method_name|
!respond_to?(method_name)
end
raise "#{self.class} should implement #{unimplemented.join(', ')}" unless unimplemented.empty?
@semanticart
semanticart / letter.rb
Last active December 21, 2015 18:19
letterpress word finder
# letters are either the first argument or something piped in
#
# e.g.
# ruby letter.rb KTVHROBDRBDLCYTPLEWAFZYMB
# or
# echo "KTVHROBDRBDLCYTPLEWAFZYMB" | ruby letter.rb
# or
# ruby -r ./board_parser -e "puts BoardParser.new('light.png').tiles.join" | ruby letter.rb
letters = (ARGV[0] || STDIN.read).downcase
# the gtk2 bit is the magic... from http://stackoverflow.com/questions/10231223/compile-vim-7-3-with-clientserver-feature-on-mac-os-x?rq=1
hg clone https://vim.googlecode.com/hg/ vim
cd vim
hg pull
hg update
./configure --enable-gui=gtk2 --enable-multibyte --with-tlib=ncurses --enable-pythoninterp --enable-rubyinterp --with-ruby-command=/usr/bin/ruby --with-features=huge
make
make install
" within a migration, do :Rredo
" the R* naming convention is to be consistent with rails-vim commands
function! Rredo()
let l:migration_version = matchstr(expand('%:p'), "\\d\\+")
call Send_to_Tmux("rake db:migrate:redo VERSION=" . l:migration_version . " --trace && rake db:test:prepare --trace\n")
endfunction
command! Rredo call Rredo()
@semanticart
semanticart / gist:1285976
Created October 14, 2011 00:59 — forked from mariovisic/gist:1281432
ruby 1.9.3 working with ruby-debug
curl https://github.com/ruby/ruby/pull/47.patch >> /tmp/r193.patch && rvm install 1.9.3-preview1 --patch /tmp/r193.patch && rm /tmp/r193.patch