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 config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit" |
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 Panther < RTanque::Bot::Brain | |
NAME = 'Survival Panther' | |
include RTanque::Bot::BrainHelper | |
def tick! | |
command.radar_heading = sensors.radar_heading + (RTanque::Heading::ONE_DEGREE * 30) | |
at_tick_interval(25) do | |
print_stats | |
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
this isn't a test |
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
# Convience method for ordanalized_date_string | |
def ods( date, day_of_week=false ) | |
return ordanalized_date_string( date, day_of_week ) | |
end | |
# Returns date string in format '29th December, 2009' i.e. UK style | |
# use instead of date.to_s( %stuff %rndstuff %another ) | |
def ordanalized_date_string( date, day_of_week=false ) | |
date_str = "#{date.day.ordinalize} %B, %Y" |
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
model.methods.sort.each{|m| puts m}; nil |
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
(Date.parse("2010-12-03")-Date.today).days |
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
3.times { | |
println it | |
} | |
println "---" | |
3.upto(9) { | |
println it | |
} | |
println "---" | |
3.step(9,3) { | |
println it |
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
if(Environment.current == Environment.DEVELOPMENT) { | |
... | |
} | |
//i.e. in Bootstrap.groovy? |
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
Original Video: http://vimeo.com/18252871 by Victor Savkin ( http://twitter.com/avix1000 ) | |
Asciicast by Ian Moss ( http://twitter.com/oceanician ) of CTI Digital: Grails team - http://www.ctisn.com | |
------------------------------------------------------------------------------------- | |
"Hi, I'm Victor Savkin." | |
"3rd Gradle screencast." | |
"Create the gradle build file" | |
"How to run the app" | |
"How to create the war" |
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
#Author: Ian Moss aka oceanician : http://twitter.com/oceanician | |
#First Published: https://gist.github.com/1009253 | |
#I'm running as part of a rails project with: | |
# ruby script/runner lib\weekends.rb | |
# Returns parameter from_date if it is a Friday. | |
def next_friday( from_date ) | |
while from_date.cwday!=5 | |
from_date = from_date + 1.day | |
end |
OlderNewer