Skip to content

Instantly share code, notes, and snippets.

View zerko's full-sized avatar

Anatoly Kudinov zerko

  • Saratov, Russia
View GitHub Profile
const Hapi = require('hapi');
const server = new Hapi.Server();
server.connection({port: 3000});
server.register(require('vision'), (err) => {
if (err) {
throw err;
}
<?php
$inline_php = 'foo';
?>
<script id="avia-filters" type="text/html">
<div class="filter-content avia">
<div class="slide-filter first">
<div>
<select data-bind="slider:true, value: serviceClass.selection">
<option value="B">One</option>
@zerko
zerko / tr.py
Created October 15, 2012 20:39
hello, lor
import httplib, urllib, re, sys
MAX_DEPTH = 2
def argparser():
return sys.argv[1]
def retrieve(host, path):
request = httplib.HTTPConnection(host)
request.request("GET", path, "", {'User-Agent' : 'Mozilla/5.0'})
@zerko
zerko / jsonp.js
Created September 23, 2011 11:30
jsonp
$(document).ready(function() {
$("#jsonpbtn").click(function() {
var surl = "http://www.fbloggs.com/sandbox/jsonp.php?callback=?";
var me = $(this);
$.getJSON(surl, function(rtndata) {
me.feedback(rtndata.message, {duration: 4000, above: true});
});
});
});
zz@zz-desktop:~$ mkvirtualenv cyctest
New python executable in cyctest/bin/python
Installing distribute..................................................................................................................................................................................done.
virtualenvwrapper.user_scripts Creating /home/zz/.virtualenvs/cyctest/bin/predeactivate
virtualenvwrapper.user_scripts Creating /home/zz/.virtualenvs/cyctest/bin/postdeactivate
virtualenvwrapper.user_scripts Creating /home/zz/.virtualenvs/cyctest/bin/preactivate
virtualenvwrapper.user_scripts Creating /home/zz/.virtualenvs/cyctest/bin/postactivate
(cyctest)zz@zz-desktop:~$ pip install -e https://github.com/fiorix/cyclone.git#egg=cyclon
--editable=https://github.com/fiorix/cyclone.git#egg=cyclon should be formatted with svn+URL, git+URL, hg+URL or bzr+URL
Storing complete log in /home/zz/.pip/pip.log
//code:
Value v= Value(typeof(Gdk.Color));
style.get_style_property(typeof(Gtk.Widget), "link-color", v);
// compile error
error: Argument 3: Cannot pass value to reference or output parameter
<?php
/* yahoo_store_export_to_froogle.pl port to PHP
# Author: Anatoly Kudinov <zz@rialabs.org>
# Original description:
# yahoo_store_export_to_froogle.pl
#
# This is a Perl script to convert Yahoo! Stores XML feed into
# Froogle data feed, and FTP the file to Froogle's server.
import unittest
import logging
logging.basicConfig(level = logging.DEBUG)
log = logging.getLogger("messaged.expression")
class MessagedExpression(object):
def __init__(self, val, msg):
self.msg = msg
@zerko
zerko / MessagedExpressions.py
Created October 25, 2010 13:46
sample for habr.ru
import unittest
import logging
logging.basicConfig(level = logging.DEBUG)
log = logging.getLogger("messaged.expression")
class MessagedExpression(object):
def __init__(self, val, msg):
log.debug("%s evaluated" % val)
@zerko
zerko / makeout
Created October 21, 2010 14:11
make output
zz@rialabs:~/nodejs-tmp/node-mongodb-native$ make
make -C ./external-libs/bson
make[1]: Вход в каталог `/home/zz/nodejs-tmp/node-mongodb-native/external-libs/bson'
rm -rf build .lock-wscript bson.node
node-waf configure build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok