This file contains hidden or 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 callbackOK_oferta(request): | |
| user = request.user | |
| reservas = Oferta_reserva.objects.filter(user=user) | |
| for reserva in reservas: | |
| if reserva.estado == 'pendiente': | |
| reserva.estado = 'completado' | |
| reserva.save() | |
| return render_to_response('reserva_pago.html', locals(), context_instance=RequestContext(request)) |
This file contains hidden or 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
| $.preloadImages = function(cantidad) { | |
| for (var i = 0; i < cantidad; i++) { | |
| $("<img />").attr("src", "/path/background-"+i+".png"); | |
| } | |
| } | |
| $.preloadImages(10); //number of backgrounds |
This file contains hidden or 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
| <!-- option[value="$$@00"]{$$@00}*24 --> | |
| <option value="00">00</option> | |
| <option value="01">01</option> | |
| <option value="02">02</option> | |
| <option value="03">03</option> | |
| <option value="04">04</option> | |
| <option value="05">05</option> | |
| <option value="06">06</option> | |
| <option value="07">07</option> | |
| <option value="08">08</option> |
This file contains hidden or 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
| .middle-vertical-align | |
| position relative | |
| top 50% | |
| transform translateY(-50%) |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| import re | |
| f = sys.argv[1] | |
| with open (f, "rt") as myfile: | |
| s=myfile.read() |
This file contains hidden or 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
| killOldersJava(){ | |
| javaProcessNumer=`ps -ej | grep java | wc -l` | |
| while [ $javaProcessNumer -gt 1 ] | |
| do | |
| PID=`ps -ej --sort=start_time | grep java | head -n1 | awk '{ print $1 }'` | |
| echo "More than one java process, killing the older PID=$PID" | |
| kill -9 $PID | |
| javaProcessNumer=`ps -ej | grep java | wc -l` | |
| done | |
| PID=`ps -ej --sort=start_time | grep java | head -n1 | awk '{ print $1 }'` |
This file contains hidden or 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
| jobs=("job1" "job2" "job3"); | |
| for job in ${jobs[@]}; do | |
| curl -s http://USER:TOKEN@URL_TO_JENKINS/job/$job/config.xml > $job.xml | |
| done |
This file contains hidden or 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
| from csv import reader, writer | |
| with open('input.csv') as inp, open('output.csv', 'w') as out: | |
| writer(out, delimiter=';').writerows(reader(inp)) |
This file contains hidden or 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
| # Start custom variables - Change this variables as you need | |
| ANDROID_VERSION=21.1.2 | |
| SSH_SIGN="SHA1: A1:A1:A1:A1:A1:A1:A1:A1:A1:A1:A1:A1:A1:A1:A1:A1:A1:A1:A1:A1" | |
| # End custom variables | |
| # Start color variables - | |
| GREEN='\033[0;32m' | |
| RED='\033[0;31m' | |
| NC='\033[0m' | |
| # End color variables |
This file contains hidden or 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 private static currentWeek() { | |
| def current = new Date().clearTime() | |
| int currentDay = Calendar.instance.with { | |
| time = current | |
| get(DAY_OF_WEEK) | |
| } | |
| def listOfDays = (current - currentDay + 2)..(current - currentDay + 8) | |
| listOfDays.collect { | |
| "date" : it.format("yyyyMMdd") | |
| } |
OlderNewer