Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Vic Shóstak koddr

🏠
Working from home
Block or report user

Report or block koddr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .zshrc
# Golang
export GOPATH="$HOME/.go"
export PATH="$PATH:$GOPATH/bin"
@koddr
koddr / get_keys_in_first_level.py
Created Apr 2, 2019
Python: JSON only get keys in first level
View get_keys_in_first_level.py
import json
string_arr = '''
{
"user": {
"code": 0,
"data": [
{
"1": {
"row": {
@koddr
koddr / Flake8.txt
Created Mar 24, 2019 — forked from tossmilestone/Flake8.txt
Flake8 integrated with PyCharm
View Flake8.txt
How to manually setup flake8 as PyCharm external tool
File / Settings / Tools / External Tools / Add
Name: Flake8
Program: $PyInterpreterDirectory$/python
Parameters: -m flake8 --max-complexity 10 --ignore E501 $FilePath$
Working directory: $ProjectFileDir$
Output Filters / Add
Name: Filter 1
@koddr
koddr / VK_API_wall_post_example.py
Last active Oct 30, 2018
VK API wall.post example (Django 1.11.x, RQ)
View VK_API_wall_post_example.py
# Import Python packages
import requests
# Import VK API
import vk
# Import Django packages
from django.contrib.sites.models import Site
from django.contrib.humanize.templatetags import humanize
# Import Django Global settings
from django.conf import settings
# Import App models
@koddr
koddr / admin.py
Created Mar 7, 2018 — forked from vero4karu/admin.py
Django: how to remove delete action/button from admin
View admin.py
class MyAdmin(admin.ModelAdmin):
def has_delete_permission(self, request, obj=None):
return False
def get_actions(self, request):
actions = super(MyAdmin, self).get_actions(request)
if 'delete_selected' in actions:
del actions['delete_selected']
return actions
View tests.py
# Import Python packages
from datetime import datetime
# Import Django Test
from django.test import TestCase
# Import App models
from .models import Journal, Children
class JournalTestCase(TestCase):
def setUp(self):
@koddr
koddr / .babelrc
Last active Jul 25, 2019
Webpack 3 config for simple Django/Flask project with Autoprefixer, PostCSS, SCSS style files, Vue.js and Babel
View .babelrc
{
"presets": ["@babel/preset-env"]
}
@koddr
koddr / auth.py
Last active Dec 17, 2017 — forked from notcammy/auth.py
Hook for Python Instagram private API for avoid re-login
View auth.py
import json
import codecs
import os.path
try:
from instagram_private_api import (
Client, ClientError, ClientLoginError,
ClientCookieExpiredError, ClientLoginRequiredError,
__version__ as client_version)
except ImportError:
import sys
You can’t perform that action at this time.