Skip to content

Instantly share code, notes, and snippets.

View carmelyne's full-sized avatar
🏡
Working from home

Carmelyne Thompson carmelyne

🏡
Working from home
View GitHub Profile
// Examples:
//
// HTML:
// <form action='messages/1/mark_unread'><input type='submit' class='button_to_link' value='Mark Unread'/></form>
//
// Rails:
// button_to "Mark as unread", mark_as_unread_message_path(message), :method => :put, :class => "button_to_link"
//
// jQuery:
// $(document).ready(function() {
hash = { :water => 'wet', :fire => 'hot' }
puts hash[:fire] # Prints: hot
hash.each_pair do |key, value| # Or: hash.each do |key, value|
puts "#{key} is #{value}"
end
# Prints: water is wet
# fire is hot
Server:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=6.06
DISTRIB_CODENAME=dapper
DISTRIB_DESCRIPTION="Ubuntu 6.06.2 LTS"
Ruby:
ruby 1.8.4 (2005-12-24) [x86_64-linux]
RubyGems:
RubyGems 0.9.2
WebServer:
sudo apt-get build-dep git-core
Reading package lists... Done
Building dependency tree... Done
Package libsvn-perl is not available,
but is referred to by another package.
This may mean that the package is missing,
has been obsoleted, or
is only available from another source
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
E: Package libsvn-perl has no installation candidate
apt-get update
apt-get upgrade
sudo apt-get install git-core
# login to remote server
ssh git@{REMOTE_SERVER}
# once logged in
mkdir example.git
# /home/git/example.git is the actual path of the above mkdir
cd example.git
# I opted out of git --bare init and just did git init
# cause I want the files as well as the differences on the git remote
git init
# on the slice
mkdir ~/.ssh
chmod 700 ~/.ssh
vim ~/.ssh/authorized_keys (use vim, nano, vi whichever you prefer)
# Paste in your public key (from local ~/.ssh/id_[rd]sa.pub)
# grabbing your public key from your local
cd ~/.ssh
cat id_rsa.pub
# Copy the entire output and paste it on ~/.ssh/authorized_keys
# from your local do:
mkdir example
cd example
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@{REMOTE_SERVER}:/home/git/example.git
git push origin master
sudo port install git-core +svn
###########################################################
# A startup item has been generated that will aid in
# starting openssh with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.OpenSSH.plist
###########################################################