Skip to content

Instantly share code, notes, and snippets.

View ebellani's full-sized avatar

Eduardo Bellani ebellani

  • Florianopolis, Brasil
View GitHub Profile
+------------------+
| <------------+ +------------------------+
| PostgreSQL | | | |
+-------+----------+ +---+-----------------+ | JS/HTML/CSS Web Apps |
| | +------> |
| | Giraffe | +------------------------+
| | |
| | Simple.Migrations |
| | |
@ebellani
ebellani / example.puml
Created June 19, 2017 04:18 — forked from QuantumGhost/example.puml
A simple template for PlantUML to draw ER diagram. The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
[Sun Jul 31 12:16:43.111882 2016] [wsgi:error] [pid 14033:tid 140207676712704] # DEBUG: hubspot.make_context
[Sun Jul 31 12:16:43.112093 2016] [wsgi:error] [pid 14033:tid 140207676712704] # DEBUG: hs_context =
[Sun Jul 31 12:16:43.112141 2016] [wsgi:error] [pid 14033:tid 140207676712704] {'ipAdress': '189.26.131.154', 'hutk': 'ccc0d2cb229871f9873a136694c7fa19', 'pageUrl': 'https://auctions.royalty
exchange.com/accounts/signup/', 'pageName': 'User Registration Form'}
[Sun Jul 31 11:34:16.167535 2016] [wsgi:error] [pid 14033:tid 140207668320000] # DEBUG: HubSpot API call (get):
[Sun Jul 31 11:34:16.167540 2016] [wsgi:error] [pid 14033:tid 140207668320000] https://api.hubapi.com/contacts/v1/contact/email/emb@brickabode.com/profile/?hapikey=cf924065-80ce-45ea-a9c9-05
7de43989a1
[Sun Jul 31 11:34:16.167544 2016] [wsgi:error] [pid 14033:tid 140207668320000]
[Sun Jul 31 11:34:16.586962 2016] [wsgi:error] [pid 14033:tid 140207668320000] # DEBUG: HubSpot API returned:
[Sun Jul 31 11:34:16.586998 2016] [wsgi:error] [pid 14033:tid 140207668320000] 200
[Sun Jul 31 11:34:16.587012 2016] [wsgi:error] [pid 14033:tid 140207668320000] {"vid":60552,"canonical-vid":60552,"merged-vids":[],"portal-id":2418407,"is-contact":true,"profile-token":"AO_T
-mNYiSlDuuQPr84ttzkG7XOYIhH1AHlwLsC82BSKk_aW4vsNGv170Sty2mqBKtcpKrs
[Sun Jul 31 09:58:27.693291 2016] [wsgi:error] [pid 7271:tid 140583779309312] # DEBUG: hubspot.make_context
[Sun Jul 31 09:58:27.735888 2016] [wsgi:error] [pid 7271:tid 140583779309312] ERROR:django.request:Internal Server Error: /accounts/signup/
[Sun Jul 31 09:58:27.735981 2016] [wsgi:error] [pid 7271:tid 140583779309312] Traceback (most recent call last):
[Sun Jul 31 09:58:27.736022 2016] [wsgi:error] [pid 7271:tid 140583779309312] File "/usr/lib/auctions-env/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
[Sun Jul 31 09:58:27.736056 2016] [wsgi:error] [pid 7271:tid 140583779309312] return self.cursor.execute(sql, params)
[Sun Jul 31 09:58:27.736069 2016] [wsgi:error] [pid 7271:tid 140583779309312] File "/usr/lib/auctions-env/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 112, in execut
e
@ebellani
ebellani / gist:d271093faaa943674df6
Created February 13, 2016 19:01
minimal example of multi expressions for a column
#+NAME: generic-tester
#+BEGIN_SRC emacs-lisp :var result="" :var expected="" :exports none
(if (equal expected result) "pass" (format "expected %S, found %S" expected result))
#+END_SRC
#+NAME: python-version
#+BEGIN_SRC python :var x=0 :var y=0
return x+y
#+END_SRC
#+attr_latex: :align |l|l|l|l|l|
| el | list of elements | expected | python | js |
|----+--------------------------------------------------+----------+--------+------------|
| 5 | '(5 5 1 7 2 3 5) | 4 | pass | pass |
| 1 | '() | -1 | pass | pass |
| 1 | (make-list 20 0) | -1 | pass | pass |
| 1 | '(1 1 1 1 1 1 1 1 1 2) | 1 | pass | it was "2" |
| 1 | (append (make-list 50 1) (make-list 50 0)) | 50 | pass | it was "2" |
| 1 | (append (make-list 50000 1) (make-list 50000 0)) | 50000 | pass | it was "2" |
#+TBLFM: $4='(let ((rslt (org-sbe "asymmetry-solution-python" (element $1) (elist $2)))) (if (string= $3 rslt) "pass" (format "it was %S" rslt))) :: $5='(let ((rslt (org-sbe "asymmetry-solution-js" (element $1) (elist $2)))) (if (string= $3 rslt) "pass" (format "
(define-syntax (relation->set stx)
(syntax-case stx ()
[(_ rel-name rel-size)
(with-syntax ([rel-vars (for/list ([x (in-range (syntax->datum #'rel-size))])
(gensym 'X))])
#`(datalog *db* (? (#,(syntax->datum #'rel-name)
#,@#'rel-vars))))]))
@ebellani
ebellani / gist:b58829a0ee49c6d5b632
Created September 9, 2015 18:21
datalog example
#lang racket
(require datalog)
(define corporate-chain
(make-theory))
(datalog corporate-chain
;; shareholders
(! (shareholder "Jorge" "pf"))
@ebellani
ebellani / datalog.rkt
Created September 9, 2015 18:02
datalog doubt
#lang racket
(require datalog)
(define corporate-chain
(make-theory))
(datalog corporate-chain
;; shareholders
(! (shareholder "Jorge" "pf"))