Skip to content

Instantly share code, notes, and snippets.

View Gmail Delayer
//labels: change the names accordingly to your needs.
//those labels have to be in the gmail.
var l_morning = GmailApp.getUserLabelByName("Delay/Morning");
var l_midday = GmailApp.getUserLabelByName("Delay/Midday");
var l_tonight = GmailApp.getUserLabelByName("Delay/Tonight");
var l_tomorrow = GmailApp.getUserLabelByName("Delay/Tomorrow");
var l_nextweek = GmailApp.getUserLabelByName("Delay/Nextweek");
//array of all the labels: DO IT
esseti / gist:fa6ba43cc37202bd1073
Created September 4, 2014 14:42
Performance generator PY
View gist:fa6ba43cc37202bd1073
from datetime import datetime
import random
#user id
sessionId = 143 #141 #142 #143
# this is needed to keep track of the new ids we create and use them in the indicator_measure
ids = []
id = int(datetime.utcnow().strftime("%s"))
esseti / gist:a7db0251e62a33437de6
Created November 7, 2014 16:45
output example
View gist:a7db0251e62a33437de6
"total": 4,
"items": [
"description": "desc",
"id": 4785074604081152,
esseti / gist:228a6c3bec325cca1d08
Created April 26, 2015 10:38
json list example
View gist:228a6c3bec325cca1d08
esseti / GcCourseFormCtrl.js
Last active August 29, 2015 14:20
Date conversion angular, directive
View GcCourseFormCtrl.js
.controller('GcCourseFormCtrl', function ($scope, gcResourceCourses, $stateParams, gettext, $timeout) {
$scope.editFn = function (course) {
$scope.edit = true;
//this is to overcome the problem in conversion.
//in this way we fake the conversion.
//we fill in the data that are shown in the form.
$scope.course._endDate = new Date(course.endDate);
$scope.course._startDate = new Date(course.startDate);
esseti / Intersting stuff
Last active October 1, 2015 11:24
Useful Things
View Intersting stuff
List of things worth to share about many things.
Randy Pausch Last Lecture: Achieving Your Childhood Dreams - - One of the best video on youtube
Randy Pausch Time Managment -
CtizenFour: kind of mind blowing. It's the story of "ed"
esseti /
Created January 29, 2013 12:07
This is an example of how to write your (Django) for running the app on AppFog and localhost without the need of changing settings every time. Plus at the bottom i added a trick on how to init the db, since AppFog does not let to do that (you have to use the tunnelling)
# Django settings for DjangoProjects project.
import os
#if this value exsist you are on appfog.
if 'VCAP_SERVICES' in os.environ:
DEBUG = False
#othewhise it's localhost
DEBUG = True
esseti / curl-trick
Created January 31, 2013 14:56
Avoid "The document has moved" in GDocs requests from curl (and similar)
View curl-trick
curl -L -d headers YOUR_URL
esseti /
Last active December 13, 2015 22:48
Pipe for django-social-auth for having a user profile populated with facebook data
class Language(models.Model):
name = models.CharField(max_length=100, default='')
fb_id = models.CharField(max_length=100, default='0')
def __unicode__(self):
return str(self.fb_id)
class UserProfile(models.Model):
user = models.OneToOneField(User)
name = models.CharField(max_length=100, default='')
esseti /
Last active December 19, 2015 07:39
Function that i created to manage some data.
def joinObjects(objects, field):
takes a list of objects and merge them.
objects are dicts
if objects have same keys, values are joined into a list.