Skip to content

Instantly share code, notes, and snippets.

View matiasherranz-santex's full-sized avatar

Matias Herranz matiasherranz-santex

View GitHub Profile
class BaseDatedModel(models.Model):
"""
Base model with creation and edition dates.
"""
created = models.DateTimeField(editable=False)
updated = models.DateTimeField(null=True, blank=True)
class Meta:
abstract = True
#!/bin/sh
# $0 is the script name, $1 id the first ARG, $2 is second...
SPRINT="$1"
PROJECT="$2"
SEPARATOR="-------------------------------------------"
RET="\n"
red=`tput setaf 1`
green=`tput setaf 2`
#!/bin/sh
# $0 is the script name, $1 id the first ARG, $2 is second...
SPRINT="$1"
PROJECT="$2"
SEPARATOR="-------------------------------------------"
RET="\n"
red=`tput setaf 1`
green=`tput setaf 2`
{
"points": [
{
"created_on": 1436889707617,
"updated_on": 1436889707617,
"read_datetime": 1436877497000,
"name": "Point A",
"accuracy": 65,
"height": 2000,
"speed": 15,
{
"track_points": [
{
"created_on": 1436889707617,
"updated_on": 1436889707617,
"read_datetime": 1436877497000,
"name": "Point A",
"accuracy": 65,
"height": 2000,
"speed": 15,
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
curl -i -X POST \
-H "Content-Type:application/json" \
-d \
'{
"users": {
"name": "Your Name",
"email": "your@mail.com",
"password": "somepass1234"
}
}' \
/* 0 */
{
"_id" : ObjectId("553fcb43f1aee34fa0200429"),
"created_on" : ISODate("2015-04-28T18:02:42.830Z"),
"updated_on" : ISODate("2015-04-30T12:54:51.845Z"),
"sequence_number" : 1,
"name" : "Crazy looking spot",
"coordinates" : [
12.1460427,
-77.02220727
/* 0 */
{
"_id" : ObjectId("553fd7d1f1aee35c16a25b1a"),
"created_on" : ISODate("2015-04-28T18:56:17.847Z"),
"updated_on" : ISODate("2015-04-28T18:56:17.848Z"),
"user" : ObjectId("5527e906f1aee364031621c6"),
"is_finished" : false,
"points" : []
}
import re
import sys
f = open(sys.argv[1], 'rb')
text = f.read()
f.close()
clean = re.sub('T(\d+:\d+:\d+.\d+)[^Z]+Z', '', text)