Skip to content

Instantly share code, notes, and snippets.

from tkinter import *
from tkinter import ttk
okno = Tk()
okno.geometry("500x600")
lbf = Frame(okno)
canvas = Canvas(lbf)
canvas.pack(side="left", fill="both", expand=1)
@LTe
LTe / main.py
Created December 20, 2019 07:29 — forked from mypy-play/main.py
Shared via mypy Playground
from typing import Iterator
def fib(n: int) -> Iterator[int]:
a, b = 0, 1
while a < n:
yield a
a, b = b, a + b
center h1 {
display: inline-block;
background-color: rgba(0, 0, 0, 0.5);
padding: 10px;
margin-top: 170px;
}
center h3 {
display: inline-block;
background-color: rgba(0, 0, 0, 0.5);
class EventFeed: Hashable, Equatable {
var eventId = 0
var hashValue : Int { return eventId }
func equals(another: EventFeed) -> Bool {
return self.eventId === another.eventId
}
}
func ==(lhs: EventFeed, rhs: EventFeed) -> Bool {
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.8.0-19-generic", arch: "amd64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /home/lite/.m2/settings.xml
[DEBUG] Using local repository at /home/lite/.m2/repository
set tags=./tags;$HOME
@LTe
LTe / bm.rb
Created May 14, 2013 10:06 — forked from paneq/bm.rb
require 'benchmark'
s1 = Struct.new(:login, :password).new("login", "password")
class S
attr_accessor :login, :password
def initialize(login, password)
@login = login
@password = password
end
require 'delegate'
class Foo
end
class Bar < SimpleDelegator
def my_method
"YAY!"
end
end
# Logfile created on 2013-03-29 11:33:37 +0100 by logger.rb/v1.2.7
I, [2013-03-29T11:33:56.887927 #9031] INFO -- :
{
"user-agent": "Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; en) Presto/2.10.289 Version/12.00",
"host": "ruby-blog.pl:8080",
"accept": "text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1",
"accept-language": "en,en-US;q=0.9",
"accept-encoding": "gzip, deflate",
"connection": "Keep-Alive"
}
require 'benchmark'
require 'exoteric'
counter = Exoteric.new(:url => 'http://github.com/')
Benchmark.bm do |x|
x.report { 10.times { counter.count(:twitter, :facebook, :plusone) } }
end