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 django.shortcuts import redirect | |
from django.shortcuts import get_object_or_404 | |
from django.views.decorators.http import require_http_methods | |
def _get_products_in_cart(request): | |
""" | |
Returns an array of dicts with the `product` and `quantity` | |
as the two keys | |
""" | |
cart = request.session.get('cart', {}) |
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
#!/bin/bash | |
# If you are too cheap (like me) to buy an expensive "smart" UPS, | |
# this script will allow you to use a Raspberry Pi or any SSH-enabled device | |
# to automatically shut down your DiskStation when the Pi loses power. | |
# Meaning you simply plug the "heartbeat device" into regular power, | |
# and your DiskStation into a UPS, and when the regular power is dead, | |
# the heartbeat device will die thus your synology will be unable to reach it | |
# and shut down in due time (10min default). | |
# This script will check if a given ssh command responds |
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
Fleminggatan / S:t Eriksgatan | |
-------------------------- | |
Vänstersväng för cyklister? Kantsten in till "väntytorna", för lite utrymme, endast vänstersvängshjälp i två av fyra hörn. Varför inte göra som i köpenhamn?? | |
norrgående Busshållplats på S:t eriksgatan skulle få cykelbana bakom busshållplatsen, något som skulle minska konflikter mellan cykel och busstrafik (i beslutet), men istället drogs ett cykelfält utanför hållplatsen, något som redan har resulterat i att en cyklist blev påkörd av en bussförare som skulle in till hållplatsen. | |
Cykelbana på s:t göransgatan togs bort och gatan dubbelriktades. Inga förbättringar gjordes för några trafikslag, inte heller passade man på att t.ex bredda trottoarerna för att få plats med uteserveringar. framkomligheten för cyklister försämrades, framkomligheten för bil blev bättre. | |
Cykelbana utanför mcdonalds togs bort och byttes mot ett cykelfält som går mellan bussfil och bilfil. Inte en trygg upplevelse och cykelfältet kommer vara osnyligt på vintern dessutom. Ändringe |
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
import Image | |
import sys | |
image = Image.open(sys.argv[1]) | |
tile_width = int(sys.argv[2]) | |
tile_height = int(sys.argv[3]) | |
zoom_level = sys.argv[4] | |
if image.size[0] % tile_width == 0 and image.size[1] % tile_height ==0 : | |
currentx = 0 |