View Gmail Delayer
This file contains 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
//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"); | |
var me = "YOUR EMAIL GOES HERE"; | |
//array of all the labels: DO IT |
View gist:fa6ba43cc37202bd1073
This file contains 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 datetime import datetime | |
import random | |
#user id | |
userId=122 | |
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")) |
View gist:a7db0251e62a33437de6
This file contains 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
http://127.0.0.1:8080/clubs?size=2 | |
{ | |
"nexPage": "E-ABAIICJ2oSZGV2fmZpbmUtcHJpZGUtNzMzchELEgRDbHViGICAgICAgIAJDIgCABQ=", | |
"total": 4, | |
"items": [ | |
{ | |
"description": "desc", | |
"id": 4785074604081152, |
View gist:228a6c3bec325cca1d08
This file contains 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
{ | |
"results":[{"name":"item1"},{"name":"item2"},{"name":"item3"},{"name":"item4"},{"name":"item5"},{"name":"item6"},{"name":"item7"},{"name":"item8"}], | |
"total":8 | |
} |
View GcCourseFormCtrl.js
This file contains 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
angular.module('gcCoachApp') | |
.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); |
View Intersting stuff
This file contains 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
List of things worth to share about many things. | |
Video: | |
Randy Pausch Last Lecture: Achieving Your Childhood Dreams - https://www.youtube.com/watch?v=ji5_MqicxSo - One of the best video on youtube | |
Randy Pausch Time Managment - https://www.youtube.com/watch?v=oTugjssqOT0 | |
CtizenFour: kind of mind blowing. It's the story of "ed" | |
View setting.py
This file contains 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
# 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 | |
else: | |
DEBUG = True |
View curl-trick
This file contains 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
curl -L -d headers YOUR_URL |
View models.py
This file contains 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
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='') |
View JoinObjects.py
This file contains 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
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. | |
[{'id':1,'tag':'ciao1'}, | |
{'id':2,'tag':['ciao1',ciao3]}, | |
{'id':1,'smt':'else2'}, | |
{'id':2,'tag':'ciao2'}] | |
becomes |
OlderNewer