Skip to content

Instantly share code, notes, and snippets.

View maizy's full-sized avatar
🕊️
-

Nikita Kovalev maizy

🕊️
-
View GitHub Profile

Note

Install as a separate pkg netatalk3. for now checkinstall not working, installing simply from make install.

But do not try to install it with standart netatalk package at the same time.

sudo apt-get remove netatalk
@maizy
maizy / summators.py
Last active August 29, 2015 13:56
выполнить, а затем разобраться почему так происходит
# coding: utf-8
# задача:
# создать список сумматоров (функций одного параметра x), возвращающих:
# x + 10 + i
# где i от 1 до 4
# lambda
rlambda = []
for i in range(5):
var i = 7
def infStream(): Stream[Int] = i #:: infStream()
val stream = infStream()
println(stream.head)
// 7
# _*_ coding: utf-8 _*_
from collections import OrderedDict
class LimitedDict(OrderedDict):
def __init__(self, limit):
super(LimitedDict, self).__init__()
self.limit = limit
@maizy
maizy / json_reader_example.sc
Last active August 29, 2015 14:04
play framework scala: json readers example
// for `play console`
// enter to paste mode before by running `:paste`
import play.api.libs.json._
import play.api.libs.functional.syntax._
case class Account(name: String)
case class Repo(
name: String,
# encoding: utf-8
def to_bin(x):
return ' '.join('{:08b}'.format(ord(i)) for i in x)
embeded_unicode = u'💩'
char_in_unicode = u'\U0001f4a9'
assert(embeded_unicode == char_in_unicode)
@maizy
maizy / README.md
Last active August 29, 2015 14:08
python wide unicode

Поддержка unicode в python и проблема "wide" unicode

wide? wtf?

Unicode символы более U+FFFF (65535) называют "wide".

Вот полная таблица диапазонов unicode на данный момент:

name description range
@maizy
maizy / result.html
Created January 29, 2015 15:57
xsl:param with nodeset
<html><body>
<h1>call 1</h1>
<div class="param1_content"><p><a href="http://example.com/">hello</a></p></div>
<h1>call 2 with param</h1>
<div class="param1_content">
oh no!
</div>
<h1>call 3 with param and value-of and apply-template</h1>
<div class="param1_content">
<b>Hello</b><b>world</b>
@maizy
maizy / app.py
Created April 2, 2015 12:21
curl async client problems
# coding=utf-8
import httplib
import importlib
import logging
import re
import time
from lxml import etree
import tornado.autoreload
@maizy
maizy / repl.md
Last active August 29, 2015 14:22
Как же передаются implicit параметры, почему не также как при карировании?

Как же передаются implicit параметры, почему не также как при карировании?

$ scala
Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_31).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import scala.reflect.runtime.{universe => u}
import scala.reflect.runtime.{universe=&gt;u}