Skip to content

Instantly share code, notes, and snippets.

@ralphschindler
ralphschindler / node_mate.rb
Created October 6, 2013 01:31
Running unsaved JavaScript though Node.js with TextMate 2 Notes: It's basically 2 files, one created with the bundle editor (See the tmCommand), and the actual node runner. This also requires an environment variable to be setup pointing to the node command line utility: TM_NODE=/usr/local/bin/node for node installed via homebrew
require "#{ENV["TM_SUPPORT_PATH"]}/lib/scriptmate"
class NodeScript < UserScript
def lang; "JavaScript" end
def default_extension; ".js" end
def args
[]
end
def executable; @hashbang || ENV['TM_NODE'] || 'node' end
def version_string
@zbyhoo
zbyhoo / gitp2svnp.rb
Last active December 23, 2016 10:37
Simple script converting git patch file into tortoise merge compatible format. Usage: gitp2svnp.rb <git_patch_file>
#!/usr/bin/ruby
if ARGV.length != 1
puts "usage: git2svn <file_name>"
puts " file_name - git patch file name"
exit
end
separator = "\n===================================================================\n"
new_file = false