Skip to content

Instantly share code, notes, and snippets.

View klinkin's full-sized avatar

Mike Klimin klinkin

View GitHub Profile
@klinkin
klinkin / bash_profile
Created April 27, 2015 12:57
bash_profile
# don't put duplicate lines in the history
export HISTCONTROL=ignoreboth:erasedups
# set history length
HISTFILESIZE=1000000000
HISTSIZE=1000000
# append to the history file, don't overwrite it
shopt -s histappend
# check the window size after each command and, if necessary, update the values of LINES and COLUMNS.
shopt -s checkwinsize
@klinkin
klinkin / lab5.py
Last active August 29, 2015 14:19
lab5.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import arrow
import requests
import itertools
import collections
from pprint import pprint
from utils import get_date, get_age
@klinkin
klinkin / mapper.py
Last active August 29, 2015 14:17
Lab2 mapper.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from time import time
import happybase
MY_N = 138
connection = happybase.Connection('172.31.25.248')
@klinkin
klinkin / config
Created March 10, 2015 11:19
ssh config file
Host 127.0.0.1ec2-52-16-125-67.eu-west-1.compute.amazonaws.com
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
@klinkin
klinkin / gist:9497833
Created March 12, 2014 00:08
MCNM-SEARCH build break
marika@air-marianna:~/Dropbox/myconomy/mcnm-search (git: master) ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
➜ ./gradlew clean
:common-lib:clean UP-TO-DATE
:search-lib:clean
:web:clean
BUILD SUCCESSFUL
Total time: 11.461 secs
marika@air-marianna:~/Dropbox/myconomy/mcnm-search (git: master) ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
marika@air-marianna.lan:~/develop/dealer (git: develop) (venv: /dealer) ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
➜ tox
GLOB sdist-make: /Users/marika/Develop/dealer/setup.py
py26 create: /Users/marika/Develop/dealer/.tox/py26
py26 installdeps: pytest, flask, django, mercurial
py26 inst: /Users/marika/Develop/dealer/.tox/dist/dealer-1.0.0.zip
py26 runtests: commands[0] | py.test
========================================================================================== test session starts ===========================================================================================
platform darwin -- Python 2.6.8 -- pytest-2.5.1
collected 9 items
@klinkin
klinkin / main.py
Last active December 20, 2015 13:39
Setup Pre/Post functions for many resources in Flask-Restless extension https://github.com/jfinkels/flask-restless/issues/235
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
__all__ = ["create_app"]
def create_app():
app = Flask("mcnmapi")
configure_blueprints(app)
@klinkin
klinkin / gist:4023885
Created November 6, 2012 10:21
Resolution
Размеры экранов
iPad 1,2
768 x 1024 (соотношение 1:1,333333)
iPad 3 Retina
1536 x 2048 (соотношение 1:1,333333)
iPhone 2G, 3G, 3Gs
# -*- coding: utf-8 -*-
from shwzkpfmobile.models import Base, BaseNode, DBSession
from shwzkpfmobile.models.content.materials import Feed
from sqlalchemy import schema, types, orm, sql
import sqlamp
import datetime
def initial_db(db):
id = schema.Column(types.Integer, primary_key=True)
@klinkin
klinkin / transloadit_example
Created September 23, 2012 10:35
transloadit_example
{% extends "base_layout.html" %}
{% block main %}
<div id="content" class="container page-content" style="padding-bottom: 228px;">
<div class="row">
<div class="span12&gt;" id="content">
<div>
<div class="row">
<div class="span7" id="details">
<div>