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 python3 | |
import urbackup_api | |
def floatWithDefault(x, default=0.0): | |
try: | |
return float(x) | |
except ValueError: | |
return default |
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/sh | |
### BEGIN INIT INFO | |
# Provides: prometheus | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Should-Start: | |
# Should-Stop: | |
# Default-Start: S | |
# Default-Stop: |
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
<?php | |
/** | |
* Joomla! External authentication script | |
* | |
* @author vdespa | |
* Version 1.0 | |
* | |
* Code adapted from /index.php | |
* | |
* @package Joomla.Site |
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 shapefile | |
# read the shapefile | |
reader = shapefile.Reader("my.shp") | |
fields = reader.fields[1:] | |
field_names = [field[0] for field in fields] | |
buffer = [] | |
for sr in reader.shapeRecords(): | |
atr = dict(zip(field_names, sr.record)) | |
geom = sr.shape.__geo_interface__ | |
buffer.append(dict(type="Feature", \ |