$ 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=>u}
This file contains hidden or 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
# coding=utf-8 | |
import httplib | |
import importlib | |
import logging | |
import re | |
import time | |
from lxml import etree | |
import tornado.autoreload |
This file contains hidden or 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
<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> |
This file contains hidden or 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
#!/bin/bash | |
# Использование: | |
# start-ssh-tunnel.sh SSH-HOST | |
# где SSH-HOST - какой-нибудь SSH хост, где github доступен. | |
# Рекомендуется сначала сделать работу с этим хостом по ключам. | |
# | |
# После выполнения всех действий https://github.com/ должен будет заработать в браузерах. | |
# Для SSH доступа к github репозиториям возможно нужно будет использовать особый порт. | |
if [[ -z $1 ]]; then |
This file contains hidden or 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
# 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) |
This file contains hidden or 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
#!/bin/sh | |
# Author: Nikita Kovalev, https://gist.github.com/maizy/c4d31c1f539694f721f6 | |
# Based on: https://gist.github.com/visenger/5496675 | |
# Use java7 dependency (openjdk) instead of java6. | |
# Tested in Ubuntu 12.04.5 (precise) | |
SCALA="2.11.2" | |
SBT="0.13.5" |
This file contains hidden or 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
// 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, |
This file contains hidden or 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
# _*_ coding: utf-8 _*_ | |
from collections import OrderedDict | |
class LimitedDict(OrderedDict): | |
def __init__(self, limit): | |
super(LimitedDict, self).__init__() | |
self.limit = limit |
This file contains hidden or 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
var i = 7 | |
def infStream(): Stream[Int] = i #:: infStream() | |
val stream = infStream() | |
println(stream.head) | |
// 7 |