Skip to content

Instantly share code, notes, and snippets.

content = {
"physician_id": "testId",
"patient_birth_date": "1937-06-19",
"observation": "The patient was ok.",
"visit_date": "2015-02-19T16:39:47.807000"
}
document = chino.documents.create(schema_id, content)
document_id = document._id
structure = [{
"name": "physician_id", "type": "string", "indexed":True
},{
"name": "patient_birth_date","type": "date", "indexed":True
},{
"name": "observation","type": "string","indexed":True
},{
"name": "visit_date","type": "datetime","indexed":True
}]
repository = chino.repositories.create('description')
repository_id = repository._id
#step 1: install library
(sudo) pip install git+https://github.com/chinoio/chino-python.git
#step 0 create chino wrapper
from chino.api import ChinoAPIClient
customer_id="<your custimer id>"
customer_key="<your cutomer key>"
url = "https://api.test.chino.io"
chino = ChinoAPIClient(customer_id=customer_id, customer_key=customer_key,url=url)
@esseti
esseti / Timer
Created January 14, 2016 22:08
TimerApp script to set slack "Do Not Disturb" during a pomodor and rest when finished.
#replace xoxp-*****000 with your token from here https://api.slack.com/web#authentication
# for the start
do shell script "curl 'https://slack.com/api/dnd.setSnooze?token=xoxp-*****000&num_minutes=$duration'"
# for the end and interuption
do shell script "curl https://slack.com/api/dnd.endSnooze?token=xoxp-*****000"
@esseti
esseti / Intersting stuff
Last active October 1, 2015 11:24
Useful Things
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"
@esseti
esseti / GcCourseFormCtrl.js
Last active August 29, 2015 14:20
Date conversion angular, directive
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);
@esseti
esseti / gist:228a6c3bec325cca1d08
Created April 26, 2015 10:38
json list example
{
"results":[{"name":"item1"},{"name":"item2"},{"name":"item3"},{"name":"item4"},{"name":"item5"},{"name":"item6"},{"name":"item7"},{"name":"item8"}],
"total":8
}
@esseti
esseti / gist:a7db0251e62a33437de6
Created November 7, 2014 16:45
output example
http://127.0.0.1:8080/clubs?size=2
{
"nexPage": "E-ABAIICJ2oSZGV2fmZpbmUtcHJpZGUtNzMzchELEgRDbHViGICAgICAgIAJDIgCABQ=",
"total": 4,
"items": [
{
"description": "desc",
"id": 4785074604081152,
@esseti
esseti / gist:fa6ba43cc37202bd1073
Created September 4, 2014 14:42
Performance generator PY
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"))