this script checks if the t-mobile site changed somehow
/**
* Created by IntelliJ IDEA.
* User: nils
* Date: Jun 14, 2010
* Time: 11:05:24 PM
*/
( 1..100000) .each {
def addy = "http://www.t-mobile.de/iphone/iphone4/0,21359,24665-_,00.html" ;
def file = new FileOutputStream ( addy.tokenize ( "/" ) [ - 1 ] )
def out = new BufferedOutputStream ( file)
out << new URL ( addy) .openStream ( )
out.close ( )
def e = new File ( "oldT-MobileSite.html" ) .length ( ) .equals ( new File ( "0,21359,24665-_,00.html" ) .length ( ) ) ;
if ( ! e) {
println "go ahead you can order now :)"
} else {
print "."
}
Thread .sleep ( 20000 ) ;
}
Categories: Uncategorized .
Tags: groovy , iphone 4 , script , t-mobile
By nils
—
June 14, 2010 at 23:27
#!/bin/bash
pidFile =~/ .appName.pid
oldPid =` cat $pidFile `
echo "killing $oldPid "
kill -9 $oldPid
date =`/ bin/ date +% Y-% m-% d:% H:% M:% S`
echo "the date for stacktrace is: $date "
appName ="$GRAILS_HOME /bin/grails -Dserver.port.https=9098 -Dserver.port=9089 -Dbase.dir=/srv/appName prod run-app -https"
cd / srv/ appName
git pull
$appName > / srv/ appName/ stacktrace-$date .log &
pid =$!
echo $pid > $pidFile
#mysql -e 'drop database appName;create database appName;'
#mysql appName < /Users/nils/dev/appName/docs/appName.sql
Categories: fedora , grails , linux , mac .
Tags: bash , grails , startup
By nils
—
May 7, 2010 at 20:31
this here is a little slideshow made in prototype javascript and scriptaculous
Facebook profile can tell you if a person is extroverted, but not if they’re neurotic: http://ow.ly/IhQB
What is
“first instance of a nonhuman mammal changing its voice to advertise her peak of fertility”?
Dmbryonic Stem Cell Research Begins With $21 Million from Obama: http://ow.ly/HWoT via @ScienceInsider
IMice genetically derived
from two mothers are smaller and live 30% longer than normally bred mice. http://ow.ly/HUu2
©pictures by David LaChapelle
the only thing which needs to be there is the script of course and those little divs:
<div id="cover"></div>
<div id="slideshowWrapper"> </div>
the content of the slideshow is everything in a div:
<div class="article-content">
<img title="rel. url" alt="" />
<img title="rel. url" alt="" />
....
<ul>
<li>quote</li>
<li>quote1</li>
<li>quote2</li>
...</ul>
.....</div>
the pictures inside #article-content are taken right away if they have a title with the relative url to the picture. the quotes are from a list like this:
...
images : $$( 'div.article-content img[title]' ) ,
text: $$( 'div.article-content ul li' ) ,
container: $( 'slideshowWrapper' ) ,
...
/*
@author: Nils M. Petersohn
*/
$$( 'div.article-content' ) .each ( function ( el) { el.hide ( ) ; } ) ;
if ( Object.isUndefined ( Cygl) ) { var Cygl = { } }
Cygl.Slideshow = Class .create ( {
initialize: function ( ) {
this .options = Object.extend ( {
images: $$( 'div.article-content img[title]' ) ,
text: $$( 'div.article-content ul li' ) ,
container: $( 'slideshowWrapper' ) ,
completeLoops: 3 ,
duration: 4 ,
showTime: 8
} , arguments[ 0 ] || { } ) ;
var that = this ;
this .start = true ;
this .faster = false ;
this .delay = 0 ;
this .delayText = 0 ;
this .orginalSize = this .options .container .getStyle ( 'width' ) .replace ( "px" , "" ) ;
this .options .images .each ( function ( el) { el.hide ( ) ; } ) ;
this .options .text .each ( function ( el) { el.hide ( ) } ) ;
var cont = this .options .container ;
var z = this .options .images .length ;
this .options .text .each ( function ( el) {
internalContainer = new Element( 'div' , { 'class' : 'quoteContainer' , 'style' : 'z-index:1000;display:none' } )
internalContainer.insert ( new Element( 'span' , { 'class' : 'quote' } ) .update ( el.innerHTML ) ) ; //
cont.insert ( internalContainer) ;
} ) ;
this .options .images .each ( function ( el) {
internalContainer = new Element( 'div' , { 'class' : 'imageContainer' , 'style' : 'z-index:' + z-- } )
internalContainer.insert ( new Element( 'img' , { 'class' : 'sildeshowImage' , src: "/" + el.title } ) ) ;
cont.insert ( internalContainer) ;
} ) ;
this .loop ( ) ;
} ,
loop: function ( ) {
var cont = this .options .container ;
var that = this ;
var switcher = false ;
var images = $$( 'div.imageContainer' ) ;
var quotes = $$( 'div.quoteContainer' ) ;
var j= 1 ;
$R( 1 , this .options .completeLoops * images.length ) .each ( function ( i) {
images.each ( function ( el) {
if ( el.getStyle ( 'z-Index' ) != 1 ) that.moveEl ( el, switcher) ;
if ( j % that.options .images .length == 0 ) switcher = ! switcher;
j++;
} ) ;
images.reverse ( ) ;
quotes.each ( function ( el) {
that.moveElText ( el, switcher) ;
} ) ;
} ) ;
} ,
moveEl: function ( el, direction) {
new Effect.Morph ( el, { style: { width: ( ( ! direction) ? '0' : this .orginalSize ) + 'px' } , delay: this .delay , duration: this .options .duration } ) ;
this .delay = this .delay + this .options .duration + this .options .showTime ;
var that = this ;
if ( this .start ) {
$$( 'div.quoteContainer' ) .each ( function ( el) {
that.moveElText ( el, direction) ;
} ) ;
this .start = false ;
}
} ,
moveElText: function ( el, direction) {
new Effect.Appear ( el, { delay: this .delayText , duration: this .options .duration , queue: 'end' } ) ;
new Effect.Fade ( el, { delay: this .delayText + this .options .showTime / 2 , duration: this .options .duration , queue: 'end' } ) ;
this .delayText = this .delayText + this .options .duration ;
}
} ) ;
Event.observe ( window, 'load' , function ( ) {
$$( 'div.article-content' ) .each ( function ( el) { el.show ( ) ; } ) ;
new Cygl.Slideshow ( ) ;
new Effect.Fade ( 'cover' , { duration: 4 } ) ;
} ) ;
#slideshowWrapper , .sildeshowImage , .imageContainer , .quoteContainer , #cover {
height : 500px ;
width : 700px ;
-webkit-border-top-left-radius: 10px ;
-webkit-border-top-right-radius: 10px ;
-webkit-border-bottom-left-radius: 10px ;
-webkit-border-bottom-right-radius: 10px ;
-moz-border-radius: 10px ;
border-spacing : 0px ;
}
.imageContainer{
position : absolute ;
overflow : hidden ;
}
#cover {
height : 503px ;
width : 703px ;
position : absolute ;
z-index : 2000 ;
background : #ECE3BA ;
}
#slideshowWrapper {
border : 1px inset #ECE3BA ;
overflow : hidden ;
}
#container img.sildeshowImage{
margin : 0px ;
}
.quoteContainer{
position : absolute ;
overflow : hidden ;
}
.quote{
-webkit-border-top-left-radius: 10px ;
-webkit-border-top-right-radius: 10px ;
-webkit-border-bottom-left-radius: 10px ;
-webkit-border-bottom-right-radius: 10px ;
-moz-border-radius: 10px ;
font-family : "Palatino Linotype" , "Book Antiqua" , Palatino, serif ;
background-color : #333 ;
color : white ;
font-weight : lighter ;
margin : 20px ;
padding : 10px ;
width : 660px ;
font-size : 50px ;
line-height : 60px ;
-moz-opacity: 0.4 ;
filter: alpha( opacity= 40 ) ;
opacity: 0.4 ;
position : absolute ;
}
#debug {
width : 700px ;
height : 200px ;
}
Categories: javascript , media .
Tags: javascript , prototype , quotes , scriptaculous , simple , slideshow
By nils
—
December 5, 2009 at 13:37