View prepare-commit-msg
#!/bin/sh | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop release hotfix) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD 2> /dev/null) | |
if [ $? -eq 0 ]; then | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
View shell
#!/bin/bash | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop release hotfix) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" | |
JIRA_ID=`echo $BRANCH_NAME | grep -oE '[A-Z]+-[0-9]+'` |
View test.py
qs = ConditionOccurrence.objects.filter( | |
condition_concept_id__in=ConceptSet.objects.get(pk=1198).concepts.values( | |
'pk')).annotate(ordinal=Window(expression=RowNumber(), order_by=F( | |
'condition_start_date').asc(), partition_by=[F('person_id')])).filter(ordinal=1) | |
... | |
django.db.utils.NotSupportedError: Window is disallowed in the filter clause. |
View example.html
<div class="collapse navbar-collapse" id="navbarSupportedContent"> | |
<ul class="navbar-nav mr-auto"> | |
{% for menu in menus %} | |
<li class="nav-item {{ menu.active }}"> | |
<a class="nav-link" href="{{ menu.path }}">{{ menu.name }}</a> | |
</li> | |
{% endfor %} | |
</ul> | |
<a href="{% url 'logout' %}">LOGOUT</a> | |
</div> |
View example.py
# context_processors.py | |
def menus(request): | |
return { | |
'menus': [ | |
{'path': reverse(path), 'name': name, | |
'active': 'active' if request.get_full_path() == reverse( | |
path) else ''} | |
for path, name in | |
( | |
('drug_sim', 'CONCEPT SETS'), ('biomarker', 'BIOMARKER'), |
View test.py
class A: | |
b = 3 | |
a = A() | |
print(a.b) # 3 | |
a.c = 4 | |
print(a.c) # 4 |
View eslintrc.js
// http://eslint.org/docs/user-guide/configuring | |
module.exports = { | |
root: true, | |
parserOptions: { | |
parser: 'babel-eslint', | |
sourceType: 'module' | |
}, | |
env: { | |
browser: true, |
View eslintrc.js
// http://eslint.org/docs/user-guide/configuring | |
module.exports = { | |
root: true, | |
parserOptions: { | |
parser: 'babel-eslint', | |
sourceType: 'module' | |
}, | |
env: { | |
browser: true, |
View settings.json
{ | |
"editor.tabSize": 2, | |
"editor.insertSpaces": true, | |
"editor.detectIndentation": false, | |
"eslint.enable": true, | |
"files.trimTrailingWhitespace": true, | |
"files.exclude": { | |
"**/.git": true, | |
"**/.svn": true, | |
"**/.DS_Store": true, |
View example.py
import json | |
import time | |
import os | |
import requests | |
import collection | |
import logging | |
import time | |
from apscheduler.schedulers.blocking import BlockingScheduler |
NewerOlder