This file contains hidden or 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
{ | |
// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
"Print to console": { | |
"prefix": "debug", | |
"body": [ | |
"import ipdb; ipdb.set_trace()" |
This file contains hidden or 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 rest_framework.test import APITestCase | |
from rest_framework import status | |
class TemporaryAuth: | |
""" | |
Use this in tests when you want to authenticate as another user. | |
args: | |
- client # (APITestCase().client) | |
- default_user # The default user used for authentication |
This file contains hidden or 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
{ | |
"python.linting.enabled": true, | |
"python.linting.flake8Enabled": true, | |
"python.linting.flake8Args": [ | |
"--ignore=E226,E266,E501,E502,W605", | |
"--enable=W0614" | |
] | |
} |
This file contains hidden or 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
[alias] | |
ci = commit | |
s = status | |
f = fetch | |
st = stash | |
co = checkout | |
di = diff --color-words | |
br = branch | |
cob = checkout -b | |
po = "!git push --set-upstream origin \"$(git rev-parse --abbrev-ref HEAD)\"" |
This file contains hidden or 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 KeyboardSensitiveRelativeLayout @kotlin.jvm.JvmOverloads constructor( | |
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : RelativeLayout(context, attrs, defStyleAttr) { | |
var listener: OnKeyboardShowHideListener? = null | |
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { | |
val proposedHeight = MeasureSpec.getSize(heightMeasureSpec) | |
val actualHeight = height | |
if (actualHeight != proposedHeight && listener != null) { | |
if (actualHeight > proposedHeight) { |
This file contains hidden or 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
data = { | |
"TestRequest": {'result': 'Test Response'} | |
} |