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 BootStrap { | |
def grailsApplication | |
grailsApplication.getArtefacts("Domain").each{dc-> | |
//here we register custom marshallers declared in domain classes | |
if(dc.hasProperty("marshaller")){ | |
dc.clazz.marshaller() | |
} | |
} |
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
package atoms.fat.media | |
import grails.converters.JSON | |
import org.joda.time.DateTime | |
class Media implements Serializable { | |
String url | |
String name | |
DateTime dateCreated |
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
def cardinalToRoman( int num){ | |
def TreeMap map = [1:"I", 5: "V", 10 : "X", 100 :"C"] | |
def getLatestKey = {int nu -> | |
def val = null | |
for (Map.Entry entry : map.descendingMap().entrySet()) { | |
def residuo = nu % entry.key; |
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
def command = """cat /var/lib/jenkins/.ssh/id_rsa.pub"""// Create the String | |
def proc = command.execute() // Call *execute* on the string | |
proc.waitFor() // Wait for the command to finish | |
// Obtain status and output | |
println "return code: ${ proc.exitValue()}" | |
println "stderr: ${proc.err.text}" | |
println "stdout: ${proc.in.text}" // *out* from the external program is *in* for 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
/* Script to upload files to S3. | |
* @author Tomas Salazar | |
*/ | |
@GrabResolver(name='jets3t', root='http://www.jets3t.org/maven2', m2Compatible='true') | |
@Grab(group='net.java.dev.jets3t', module='jets3t', version='0.9.0') | |
import org.jets3t.service.impl.rest.httpclient.RestS3Service | |
import org.jets3t.service.security.AWSCredentials | |
import org.jets3t.service.model.* | |
accessKey = 'Cambiar' |
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
#!/bin/bash | |
fecha=$(date +%Y%m%d_%H%M) | |
echo "ready to dump database" | |
mysqldump -u root database --ignore-table=logs > /tmp/dump-$fecha.sql | |
echo "comprimiendo" | |
pbzip2 /tmp/dump-$fecha.sql |
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
#!/bin/bash | |
NUMBER_DESkTOP="$(xdotool get_num_desktops)" | |
CURRENT="0" | |
echo "Press [CTRL+C] to stop.." | |
while : | |
do | |
xdotool set_desktop $CURRENT | |
#echo $CURRENT | |
CURRENT="$(expr $CURRENT + '1')" | |
if [ "$CURRENT" -gt $NUMBER_DESkTOP ]; then |
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
dir=/tmp/level1/level2/level3/level4/level5/level6; while [ "$dir" != "/" ]; do ls -ald $dir; dir=`dirname $dir`; done |
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
/* * | |
* Arduino Telnet Server * | |
* 7 July 2010 * | |
* Basic Arduino I/O via * | |
* a command line interface * | |
* by Steve Lentz * | |
* stlentz[at]gmail[dot]com * | |
Quick Start Instructions: | |
1) Set Ethernet address in code below. |
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
<?xml version='1.0' encoding='utf-8'?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |