- Install MacPorts
- Install
apple-gcc-42
via MacPorts:sudo port install apple-gcc-42
- Install RVM (I had some issues with
stable
, so I went with1.10.2
, butstable
might work for you):bash -s -- --version 1.10.2 < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
- Install Ruby 1.8.7 using
apple-gcc-42
:CC=/opt/local/bin/gcc-apple-4.2 rvm install 1.8.7
- Enjoy!
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
<plugin> | |
<groupId>org.glassfish.maven.plugin</groupId> | |
<artifactId>maven-glassfish-plugin</artifactId> | |
<version>2.1</version> | |
<configuration> | |
<glassfishDirectory>${glassfish.home}</glassfishDirectory> | |
<user>${domain.username}</user> | |
<passwordFile>${glassfish.home}/domains/${project.build.finalName}/master-password</passwordFile> | |
<autoCreate>true</autoCreate> | |
<debug>true</debug> |
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
function installAnimation(inputElem, marginTopEnd, animationLength) { | |
$(inputElem).bind('input', function() { | |
var label = $(this).prev("label"); | |
var labelMarginTop = label.css('margin-top'); | |
label.stop(); | |
if ($(this).val().length > 0) { | |
animateMarginTop(label, marginTopEnd, animationLength); | |
} else if ($(this).val().length == 0) { | |
animateMarginTop(label, "0px", animationLength); | |
} |
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
<!-- Parent POM: --> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>foo</groupId> | |
<artifactId>parent</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>pom</packaging> |
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
<!-- Parent POM --> | |
<!-- Spring --> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-context</artifactId> | |
<version>${spring.version}</version> | |
<scope>compile</scope> | |
</dependency> | |
<!-- child POM --> |
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
$ git checkout develop | |
$ git merge --no-ff myfeature | |
$ git branch -d myfeature | |
$ git push origin develop |
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
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML) | |
code = "```ruby | |
1 + 1 | |
```" | |
markdown.render(code) | |
# produces | |
# <p><code>ruby\n1 + 1\n</code></p>\n | |
# rather than | |
# <p><code>1 + 1\n</code></p>\n |
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
class UsersController < ApplicationController | |
before_filter :authenticate, :only => [:index, :edit, :update] | |
before_filter :correct_user, :only => [:edit, :update] | |
before_filter :admin_user, :only => :destroy | |
def index | |
@title = "All users" | |
@users = User.paginate(:page => params[:page]) | |
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
# Install with: | |
# bash < <(curl -L https://raw.github.com/gist/2249371) | |
# | |
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug | |
echo "Installing ruby-debug with ruby-1.9.3-p125 ..." | |
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem | |
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |