> cd /usr/local/Library/Formula/
> git co 08a087e4c240fa5e1c1a35495393bf164b3c25f7 elasticsearch.rb
> brew upgrade elasticsearch
> launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
> launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
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
array = [1,2,3] | |
current_index = 0 | |
squares = [] | |
loop do | |
if current_index < array.size | |
squares << array[current_index] ** 2 | |
current_index += 1 | |
else | |
break |
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
# Configuring Our Prompt | |
# ====================== | |
# if you install git via homebrew, or install the bash autocompletion via homebrew, you get __git_ps1 which you can use in the PS1 | |
# to display the git branch. it's supposedly a bit faster and cleaner than manually parsing through sed. i dont' know if you care | |
# enough to change it | |
# This function is called in your prompt to output your active git branch. | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\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
Show hidden characters
{ | |
"bold_folder_labels": true, | |
"caret_style": "phase", | |
"color_scheme": "Packages/Solarized Color Scheme/Solarized (light).tmTheme", | |
"fade_fold_buttons": false, | |
"font_face": "Inconsolata", | |
"font_size": 16, | |
"highlight_line": true, | |
"ignored_packages": | |
[ |
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 index | |
urls = %w[http://cltampa.com/blogs/potlikker http://cltampa.com/blogs/artbreaker http://cltampa.com/blogs/politicalanimals http://cltampa.com/blogs/earbuds http://cltampa.com/blogs/dailyloaf http://cltampa.com/blogs/bedpost] | |
@final_images = [] | |
@final_urls = [] | |
urls.each do |url| | |
blog = Nokogiri::HTML(open(url)) | |
images = blog.xpath('//*[@class="postBody"]/div[1]//img/@src') | |
images.each do |image| | |
@final_images << image |
NewerOlder