This file contains 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
def line | |
new File("test.txt").withReader { line = it.readLine() } | |
println line |
This file contains 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
def updateBuildVersion(currentVersion, updateType) { | |
def versionMatcher = currentVersion =~ /^(\d+)\.(\d+)\.(\d+)$/ | |
def major = versionMatcher[0][1].toInteger() | |
def minor = versionMatcher[0][2].toInteger() | |
def patch = versionMatcher[0][3].toInteger() | |
if (updateType == 'patch') | |
patch += 1 | |
else if (updateType == 'minor') | |
minor += 1 |
This file contains 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
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */ | |
{ | |
/* | |
* Keybindings for emacs emulation. | |
* | |
* WARNING! After Mountain Lion, this file cannot be symbolic linked to another file, | |
* you need to put this file in ~/Library/KeyBindings/DefaultKeyBinding.dict directly | |
* | |
* Reference: |
This file contains 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
require 'kramdown' | |
puts Kramdown::Document.new(File.open('test.md').read).to_html |
This file contains 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
def timeMethod(method, message) { | |
def startTime = System.currentTimeMillis() | |
method() | |
def totalTime = System.currentTimeMillis() - startTime | |
log.info "${message} ${totalTime} ms" | |
} | |
... | |
timeMethod({ someMethod() }, "someMethod Time:") | |
... |
This file contains 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
Finds: | |
routing_number\": \"01030800\" | |
account_number\": \"02010101\" | |
Grep with perl: | |
grep -Poh 'routing_number\\".*?\\".*?\\"' file.txt | |
grep -Poh 'account_number\\".*?\\".*?\\"' file.txt |
This file contains 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
# Install node http-server | |
sudo npm install http-server -g | |
# Install ngrok - https://ngrok.com/ | |
brew install ngrok | |
# Change to the directory you want to serve: |
This file contains 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
# run as: ruby sym_link_reso.rb input.txt | |
lines = open(ARGV[0]).readlines | |
directory = lines.last | |
symlinks = lines[1..-2].each_with_object({}) do |line, hash| | |
symlink = line.chomp.split(':') | |
hash[symlink[0].chomp("/")] = symlink[1].chomp("/") | |
end |
This file contains 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
Yank normally, but just copy it automatically to your system clipboard as well. | |
Added to my .vimrc. Should work from visual mode when you press y and from ex mode: 1,10YankToSystemRegister | |
" Auto Yank text to the OS X clipboard | |
function! CopyToSystemRegister() | |
let @*=@" | |
endfunction | |
command! -range -bar YankToSystemRegister <line1>,<line2>yank|call CopyToSystemRegister() | |
vnoremap y :YankToSystemRegister<cr> |
This file contains 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
Fiction: | |
On Writing (Stephen King) | |
Masters of Doom | |
Hackers: Heroes of the computing revolution | |
Sci fi: | |
Ready Player One | |
Cryptonomicon | |
Old Mans War |
OlderNewer