Skip to content

Instantly share code, notes, and snippets.

View avolkov's full-sized avatar

Alex Volkov avolkov

View GitHub Profile
@avolkov
avolkov / date_timedelta_math.py
Created January 23, 2020 22:48
datetime.date can do math with timedelta periods
from datetime import date, timedelta
today = date.today()
monday = today - timedelta(today.weekday())
for k in range(0,7):
print(monday + timedelta(days=k))
@avolkov
avolkov / .gitconfig
Last active June 12, 2019 17:46
This configures 'git prunelocal' command that deletes all local branches that do not track a branch in remote/origin. Place git_prune_local.sh into /usr/local/bin. Inspired this comment in stack overflow, but I wanted to run code I understand. https://stackoverflow.com/questions/20106712/what-are-the-differences-between-git-remote-prune-git-prun…
# Add this under 'alias' section in .gitconfig
[alias]
prunelocal="!f(){ git_prune_local.sh; }; f"
- Content warnings are previews for sensitive content, such as political rants, description of violence, NSFW content or similar things that would make your users uncomfortable or get them in trouble.
- Content warnings aren't sensoship as your readers given a choice if they want to read text underneath your content warning
- To add a content warning click on 'cw' image in your post interface
- The heading would appear in place of "Write your warning here"
- Text hidden behind content warning will appear in place on "What's on your mind"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"SublimeLinter":
{
"@python": 2.7,
"linters":
{
"flake8":
{
"max-line-length": 120
}
[
{
// map anaconda goto definition to F8
"command": "anaconda_goto", "keys": ["f8"], "context": [
{"key": "selector", "operator": "equal", "operand": "source.python"}
]
}
]
@avolkov
avolkov / gist:674c9663374b79128297
Created March 27, 2015 22:07
Plock, an issue with Plone 3.0.6
$ ./bin/buildout -v -c buildout.cfg
Installing 'plone.recipe.plone'.
We have no distributions for plone.recipe.plone that satisfies 'plone.recipe.plone==3.0.6'.
Getting distribution for 'plone.recipe.plone==3.0.6'.
Got plone.recipe.plone 3.0.6.
Adding find link 'http://download.zope.org/distribution/' from plone.recipe.plone 3.0.6
Getting required 'plone.recipe.distros'
required by plone.recipe.plone 3.0.6.
We have no distributions for plone.recipe.distros that satisfies 'plone.recipe.distros'.
Getting distribution for 'plone.recipe.distros'.
@avolkov
avolkov / gist:1e13944949c1b802bfd7
Created March 27, 2015 14:46
Plone 3.0.6 version pinning
[versions]
# Version pins for new style products go here
plone.recipe.zope2instance = 3.6
setuptools = 1.4.2
plone.recipe.plone = 3.0.6
@avolkov
avolkov / gist:b5f801ac55f46cbd36af
Created March 27, 2015 01:11
plone 3.0.6 buildout log
(python24)[alex@alex-c720[21:06:21]:ocf]
$ ./bin/buildout -c buildout.cfg -v
Installing 'zc.buildout', 'setuptools'.
We have a develop egg: zc.buildout 1.4.4
We have no distributions for setuptools that satisfies 'setuptools==1.4.2'.
Getting distribution for 'setuptools==1.4.2'.
Running easy_install:
/home/alex/.virtualenvs/python24/bin/python "-c" "from setuptools.command.easy_install import main; main()" "-mUNxd" "/home/alex/projects/ocf/eggs/tmpB-hv1B" "-q" "/tmp/tmpTnI11Wget_dist/setuptools-1.4.2.tar.gz"
path=/home/alex/projects/ocf/eggs/setuptools-0.6c11-py2.4.egg
@avolkov
avolkov / buildout.cfg
Created March 27, 2015 00:51
plone 3.0.6 buildout
[buildout]
parts =
plone
zope2
productdistros
instance
zopepy
versions = versions