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
Groovy also has a Time Category class which gives you DSL style syntax for manipulating dates. Here is an example: | |
import org.codehaus.groovy.runtime.TimeCategory | |
now = new Date() | |
println now | |
use(TimeCategory) { | |
footballPractice = now + 1.week - 4.days + 2.hours - 3.seconds | |
} | |
println footballPractice | |
which will produce output like this: |
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
var pass = document.basic.password.value; | |
var chars = pass.length; | |
var l_let = pass.match(/[a-z]/g).length; | |
var u_let = pass.match(/[A-Z]/g).length; | |
var num = pass.match(/\d/g).length; | |
alert( | |
"# Chars: "+chars+"\n"+ | |
"# Lower: "+l_let+"\n"+ | |
"# Upper: "+u_let+"\n"+ | |
"# Numbers: "+num |
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
Ref http://devcenter.heroku.com/articles/custom-domains | |
Heroku Setup | |
1. Install Custom Domain Plugin for your app | |
heroku addons:add custom_domains | |
2. Add domain names | |
heroku domains:add www.example.com | |
GoDaddy Setup | |
1. Go to your domain under your account |
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
heroku sharing:add [email protected] |
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
init_static_site(){ | |
PROJECT_NAME=$1 | |
if [[ -z "$PROJECT_NAME" ]] then | |
PROJECT_NAME="site" | |
echo "| You didn't define a name for the site folder, setting it to 'site' by default" | |
fi | |
mkdir -p $PROJECT_NAME/public/{images,js,css} | |
touch $PROJECT_NAME/{config.ru,public/index.html}i | |
cd $PROJECT_NAME && touch Gemfile && echo "source \"https://rubygems.org\"\ngem 'rack'" >> Gemfile |
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
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" let Vundle manage Vundle | |
" required! | |
Bundle 'gmarik/vundle' |
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
# ~/.tmux.conf | |
# | |
# See the following files: | |
# | |
# /opt/local/share/doc/tmux/t-williams.conf | |
# /opt/local/share/doc/tmux/screen-keys.conf | |
# /opt/local/share/doc/tmux/vim-keys.conf | |
# | |
# URLs to read: | |
# |
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
repositories { | |
grailsHome() | |
mavenCentral() | |
grailsCentral() | |
mavenRepo "http://repo.spring.io/milestone" | |
} | |
dependencies { | |
compile "org.springframework.cloud:cloudfoundry-connector:0.9.5" | |
compile "org.springframework.cloud:spring-service-connector:0.9.5" |
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
var tumblrAPIURL = "http://api.tumblr.com/v2/blog/wawandco.tumblr.com/posts/text?callback=JSON_CALLBACK&api_key="+$scope.consumerKey; | |
$http.jsonp(tumblrAPIUrl) .success(function(data){ | |
$scope.posts = data.response.posts; | |
}); |
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
grails prod war && cf push ourApp -p target/ourApp.war |