Skip to content

Instantly share code, notes, and snippets.

@vbabiy
vbabiy / 0_reuse_code.js
Created March 27, 2014 15:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@vbabiy
vbabiy / python_resources.md
Created March 27, 2014 15:28 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

vbabiy@app13:/etc/varnish$ curl -X PURGE -H "Host: www.smithsonianmag.com" http://127.0.0.1:6081/travel/underwater-museum-180951559/ -I
HTTP/1.1 200 Purged.
Server: Varnish
Content-Type: text/html; charset=utf-8
Content-Length: 9218
Accept-Ranges: bytes
Date: Thu, 12 Jun 2014 19:13:06 GMT
X-Varnish: 1816509156
Age: 0
Via: 1.1 varnish
(python3.1) vbabiy@ubuntu ~/Projects/git-projects/pip [python3••] ❯❯ python setup.py test
running test
running egg_info
writing pip.egg-info/PKG-INFO
writing top-level names to pip.egg-info/top_level.txt
writing dependency_links to pip.egg-info/dependency_links.txt
writing entry points to pip.egg-info/entry_points.txt
reading manifest file 'pip.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs/_build/_sources'
(python3.1) vbabiy@ubuntu ~/Projects/git-projects/pip [python3•] ❯❯ time nosetests -v -x tests.test_basic
Check we are running proper version of pip in run_pip. ... ERROR
======================================================================
ERROR: Check we are running proper version of pip in run_pip.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vbabiy/.virtualenvs/python3.1/lib/python3.1/site-packages/nose/case.py", line 188, in runTest
self.test(*self.arg)
File "/mnt/hgfs/mac_home/Projects/git-projects/pip/tests/test_basic.py", line 20, in test_correct_pip_version
(python3.2) vbabiy@ubuntu ~/Projects/git-projects/pip [python3•] ❯❯ time nosetests -v -x tests.test_basic
Check we are running proper version of pip in run_pip. ... ok
Check if ``pip-<PYVERSION>`` commands behaves equally ... ok
Test installing a package from PyPI. ... ok
Test installing a package from the PyPI mirrors. ... ok
Test installing a package from a specific PyPI mirror. ... ok
Test editable installation. ... ok
Test checking out from svn. ... ok
Test downloading an editable using a relative custom src folder. ... ok
Test installing an editable in two steps (first with --no-install, then with --no-download). ... ok
import unittest
from chai import Chai
class Walrus(object):
def __init__(self):
self.energy = 0
def receive_gift(self, gift):
if gift.is_editable():
@vbabiy
vbabiy / gist:4519573
Last active December 11, 2015 00:49
Get Location
navigator.geolocation.getCurrentPosition(function(args) {
console.log(args.coords.latitude,args.coords.longitude)
}, function(error) {
console.error(error);
});
@vbabiy
vbabiy / Test
Created April 5, 2013 15:03
Test
print "Hello World"
@vbabiy
vbabiy / became.py
Created July 24, 2013 22:48
Working extract method
class TestHome(TestCase):
def test_home_template_used(self):
res = self.get_name()
self.assertTemplateUsed(res, 'home.html')
def get_name(self):
res = self.client.get('/')
return res
def test_home_template_contains_hello_world(self):