Skip to content

Instantly share code, notes, and snippets.

View mariomartinezsz's full-sized avatar

Mario Martínez Sánchez mariomartinezsz

View GitHub Profile
module ProtobufSerializationTests
open System
open System.IO
open ProtoBuf
open Xunit
module ProtoBufUtils =
[<ProtoContract>]
@mariomartinezsz
mariomartinezsz / postgis_geojson.php
Created June 14, 2019 04:38 — forked from bmcbride/postgis_geojson.php
PHP PostGIS to GeoJSON
<?php
/**
* PostGIS to GeoJSON
* Query a PostGIS table or view and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc.
*
* @param string $geotable The PostGIS layer name *REQUIRED*
* @param string $geomfield The PostGIS geometry field *REQUIRED*
* @param string $srid The SRID of the returned GeoJSON *OPTIONAL (If omitted, EPSG: 4326 will be used)*
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* NOTE- Uppercase field names should be wrapped in double quotes
* @param string $parameters SQL WHERE clause parameters *OPTIONAL*
@mariomartinezsz
mariomartinezsz / langoliers.rb
Created May 7, 2016 16:00 — forked from robinsloan/langoliers.rb
Tweet delete script
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'json'
require 'faraday'
# things you must configure
PATH_TO_DROPBOX = "/Users/your_name/Dropbox/backup/tweets/" # you need to create this folder
TWITTER_USER = "your_twitter_username"
public class RestClient {
private ArrayList<NameValuePair> params;
private ArrayList<NameValuePair> headers;
private String url;
private int responseCode;
private String message;
@mariomartinezsz
mariomartinezsz / gist:7405775
Last active April 20, 2017 00:24 — forked from clsung/gist:6822574
"A simple crop image to 80x80 jpeg file script" with GoLang
package main
import (
"fmt"
"os"
"log"
"flag"
"image"
_ "image/gif"
"image/jpeg"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Simple script to create geojson from osm files.
Prints geojson features line by line.
Currently we don't support relations.
Requires (unmodified) imposm and imposm.parser
Inspired by https://github.com/emka/OSMCouch
'''
#!/bin/sh
if [ -z "$6" ]
then
echo "Usage: `basename $0` [-n] <filename> <start time> <duration> <scale to width> <framestep> <resultname.gif>\n-n — turn off subtitles"
else
OPT=
if [ "$1" = "-n" ]
then
OPT="-nosub -noautosub"
shift