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
# -*- coding: utf-8 -*- | |
# XXX this is actually useful for very special use cases, e.g. misspel suggestions: | |
# https://www.postgresql.org/docs/9.6/static/pgtrgm.html#AEN180626 | |
from __future__ import unicode_literals | |
from django.db import migrations | |
from django.contrib.postgres.operations import TrigramExtension | |
class Migration(migrations.Migration): | |
operations = [ |
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
\documentclass[20pt,english,landscape]{extarticle} | |
\usepackage{multicol} | |
\usepackage{calc} | |
\usepackage[landscape]{geometry} | |
\usepackage{color,graphicx,overpic} | |
\usepackage[T1]{fontenc} | |
\usepackage[bitstream-charter]{mathdesign} | |
\usepackage[utf8]{inputenc} | |
\usepackage{url} |
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 c='cd' | |
alias m='mc' | |
alias v='vim' | |
alias e='emacs -nw' | |
alias l='ls' | |
alias gg='git gui' | |
alias dc='docker-compose' |
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
;; put this to dotspacemacs/user-config | |
(defun left-key-stub () | |
(interactive) | |
(message "Use Vim keys: <h> for Left, <b> for previous word")) | |
(define-key evil-normal-state-map (kbd "<left>") 'left-key-stub) | |
(define-key evil-insert-state-map (kbd "<left>") 'left-key-stub) | |
(define-key evil-visual-state-map (kbd "<left>") 'left-key-stub) | |
(defun right-key-stub () | |
(interactive) |
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
set autohidecursor | |
set showtabindices | |
set sortlinkhints | |
let completionengines = ["google"] | |
let hintcharacters = "asdfghjkl" | |
map <C-f> scrollFullPageDown | |
map <C-b> scrollFullPageUp | |
map <C-d> scrollPageDown | |
map <C-u> scrollPageUp |
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
# ... | |
import django | |
from django.utils import autoreload | |
import uwsgi | |
def reloader(): | |
if django.conf.settings.DEBUG: | |
print('Starting debug reloader') |
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
def multipliers(): | |
return [lambda x, idx=i: idx * x for i in range(4)] | |
print([m(2) for m in multipliers()]) |
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
import numpy as np | |
np.real(-7 * np.exp(np.pi * 1j + np.log(6))) |
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
import matplotlib.pyplot as plt | |
%matplotlib inline | |
import numpy as np | |
%pylab inline | |
pylab.rcParams['figure.figsize'] = (6, 10) | |
x = np.linspace() #ваши цифры в скобках | |
y = # ваш код для функции | |
plt.plot(x, y); |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
class Context(): | |
def __enter__(self): | |
print('__enter__') | |
def __exit__(self, *args): | |
print('__exit__') |
OlderNewer