Skip to content

Instantly share code, notes, and snippets.

View maxtortime's full-sized avatar

Kim Taehwan maxtortime

View GitHub Profile
@maxtortime
maxtortime / prepare-commit-msg
Last active July 30, 2020 08:16 — forked from qkraudghgh/shell
feature/sample 이름을 가진 브랜치일때 커밋 메시지 앞에 [sample] 을 붙여주는 훅
#!/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##*/}"
@maxtortime
maxtortime / shell
Created July 30, 2020 08:13 — forked from qkraudghgh/shell
pre commit
#!/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]+'`
@maxtortime
maxtortime / test.py
Created October 23, 2018 06:50
filter by annotated window
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.
@maxtortime
maxtortime / example.html
Created August 13, 2018 01:41
django navbar for문
<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>
@maxtortime
maxtortime / example.py
Last active August 13, 2018 01:44
navbar 만들기
# 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'),
class A:
b = 3
a = A()
print(a.b) # 3
a.c = 4
print(a.c) # 4
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
@maxtortime
maxtortime / settings.json
Last active April 29, 2018 03:20
Adjust eslint-plugin-vue
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"eslint.enable": true,
"files.trimTrailingWhitespace": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.DS_Store": true,
@maxtortime
maxtortime / example.py
Created April 17, 2018 09:30
python apscheduler example
import json
import time
import os
import requests
import collection
import logging
import time
from apscheduler.schedulers.blocking import BlockingScheduler