This file contains 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/perl | |
# | |
$text = <>; | |
@links = $text =~ m/href=\"([^\"]+)/g; | |
print join ("\n", @links), "\n"; |
This file contains 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
filetype off | |
call pathogen#runtime_append_all_bundles() | |
" making CommandT work... | |
map <C-t> :CommandT<CR> | |
syntax enable | |
set background=light | |
set t_Co=16 | |
let g:solarized_termcolors=16 | |
colorscheme solarized |
This file contains 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
sudo apt-get install libsqlite3-dev | |
gem install sqlite3 -v '1.3.7' |
This file contains 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
# https://rvm.io/packages/openssl/ - look | |
sudo apt-get install openssl # do i need this? | |
rvm pkg install openssl | |
rvm reinstall all --force |
This file contains 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 ParseTarget(object): | |
TYPES = frozenset(('tire', 'disc', 'oil', 'acc', 'additional',)) | |
def __init__(self): | |
self.current_tag = None | |
self.current_type = None | |
self._depth = 0 |
This file contains 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 AbstractParseTarget(object): # http://lxml.de/parsing.html#the-target-parser-interface | |
def __init__(self): | |
self.current_tag = None | |
def start(self, tag, attrib): | |
self.current_tag = tag | |
method = getattr(self, '%s_start' % tag, None) | |
if method: |
This file contains 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 django.conf import settings | |
def send_sms(phone, text): | |
q = ("<?xml version='1.0' encoding='UTF-8'?><data><login>%(login)s</login>" + | |
"<password>%(password)s</password><text>%(text)s</text><to number='%(phone)s'></to></data>") % { | |
'phone': phone.encode('utf-8'), | |
'text': text.encode('utf-8'), | |
'login': settings.SMS_INTELL_LOGIN, | |
'password': settings.SMS_INTELL_PASSWORD, | |
} |
This file contains 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
EMAIL_HOST = 'smtp.yandex.ru' | |
EMAIL_HOST_USER = 'login@example.com' | |
EMAIL_HOST_PASSWORD = 'password' | |
EMAIL_PORT = 587 | |
EMAIL_USE_TLS = True |
This file contains 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 tinymce | |
from django_any import xunit | |
from django_any.models import any_model, any_field | |
@any_field.register(tinymce.models.HTMLField) | |
def any_tinymce_html_field(*_): | |
return xunit.any_string(min_length=1, max_length=400) |
This file contains 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
{# use in combination with https://github.com/zyga/django-pagination #} | |
{# and http://twitter.github.com/bootstrap/ #} | |
{# project-dir/templates/pagination/pagination.html #} | |
{% if is_paginated %} | |
{% load i18n %} | |
<div class="pagination"> | |
<ul> | |
{% block previouslink %} | |
{% if page_obj.has_previous %} |