Skip to content

Instantly share code, notes, and snippets.

View robot.js
var Robot = function(robot) {
// var robot = ev.robot;
}
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
robot.rotateCannon(360);
robot.turn(360)
We couldn’t find that file to show.
We couldn’t find that file to show.
We couldn’t find that file to show.
View WCC2012_23.groovy
public class WCC2012_23 {
Expression bestSolution = null
BigDecimal target = null
List list
enum Operation {
plus('+'), minus('-'), multiply('*'), div('/')
String symbol
@deluan
deluan / attendees2csv.groovy
Created Dec 11, 2011
Script to export attendees from an Facebook Event ICS (iCalendar) file to a CSV file.
View attendees2csv.groovy
#!/usr/bin/env groovy
import java.util.regex.*
def inviteFileName = args[0]
def inviteFile = new File(inviteFileName)
def pattern = Pattern.compile('^ATTENDEE;CN=(.*);PARTSTAT=ACCEPTED:(.*)')
inviteFile.eachLine { line ->
def m = pattern.matcher(line)
View EnglishDateFormatterThreadLocal.groovy
package com.deluan.grails.util
import java.text.SimpleDateFormat
import com.grailsrocks.cacheheaders.DateFormatterThreadLocal
/**
* This class is used to force CacheHeadersService (from the cache-headers
* plugin) to generate http-dates in english. It MUST be used when the
* locale of your server is not English.
* <p/>
@deluan
deluan / UtilFilters.groovy
Created Dec 17, 2010
Grails request profiling example
View UtilFilters.groovy
class UtilFilters {
def filters = {
profiler(controller: '*', action: '*') {
before = {
request._timeBeforeRequest = System.currentTimeMillis()
}
after = {
@deluan
deluan / griffon.sh
Created Oct 31, 2010
Script for selecting and calling the correct Griffon version when you have more than one version installed
View griffon.sh
#!/bin/sh
# Author: Deluan (http://techbeats.deluan.com)
# Check if GRIFFON_HOME is set
if [ -z "$GRIFFON_HOME" -o ! -d "$GRIFFON_HOME" ]; then
echo "Error: GRIFFON_HOME not set"
exit 2
fi
# Extract the default version and base path from GRIFFON_HOME
@deluan
deluan / dependency_pom.xml
Last active Oct 5, 2016
Adding shiro-faces taglib to your maven project
View dependency_pom.xml
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-faces</artifactId>
<!-- See the latest version on the project's homepage -->
<version>2.0</version>
</dependency>