Skip to content

Instantly share code, notes, and snippets.

View krichtof's full-sized avatar

krichtof krichtof

View GitHub Profile
@krichtof
krichtof / found.rb
Last active January 27, 2020 12:28
Check if a http resource is found
def found?(url)
uri = URI(url)
response = nil
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |http|
response = http.head(uri.path)
end
(response.is_a? Net::HTTPFound) || (response.is_a? Net::HTTPOK)
end

Keybase proof

I hereby claim:

  • I am krichtof on github.
  • I am krichtof (https://keybase.io/krichtof) on keybase.
  • I have a public key ASAacdTEy6EqEu9mG1tIfBtZlasDqy8_dgoFTkFLV6kxDwo

To claim this, I am signing this object:

if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
source ~/.git-completion.bash
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
#GIT_PS1_SHOWDIRTYSTATE=false
#export PS1='\[\033[1;36m\]\u at\[\033[00m\] \[\033[34m\]\W > '
@krichtof
krichtof / ContactsController
Created February 5, 2012 18:49
Problem with rails3-jquery-autocomplete
class ContactsController < ApplicationController
autocomplete :company, :name
...