Skip to content

Instantly share code, notes, and snippets.

@Yardanico
Yardanico / test.py
Created October 19, 2016 18:54
tqdm example
import tqdm
def get_values(count):
for x in range(count):
yield x*count
for x in tqdm.tqdm(get_values(10000000)):
pass
@Yardanico
Yardanico / test.py
Created December 10, 2016 16:00
test
class PythonFunction:
def __init__(self, args):
self.rtype, self.name, self.params = args
def generate_python(self):
pure_arguments = []
arguments = []
for param in self.params:
name, type = param
if name == 'callback':
@Yardanico
Yardanico / test.py
Created December 10, 2016 16:01
generated example
def uiDrawFontFamiliesNumFamilies(ff: uiDrawFontFamilies):
"""
Describe the function.
:param args: arguments
:return: value
"""
return clibui.uiDrawFontFamiliesNumFamilies(ff)
@Yardanico
Yardanico / trace
Created February 5, 2017 14:02
AimTux crash
Thread 1 "csgo_linux64" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
58 ../sysdeps/unix/sysv/linux/raise.c: Нет такого файла или каталога.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#1 0x00007f859a0733ea in __GI_abort () at abort.c:89
#2 0x00007f85995a558d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007f85995a3336 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007f85995a3381 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007f85995a3599 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
@Yardanico
Yardanico / heartbleed.py
Created February 9, 2017 19:28 — forked from eelsivart/heartbleed.py
Heartbleed (CVE-2014-0160) Test & Exploit Python Script
#!/usr/bin/python
# Modified by Travis Lee
# Last Updated: 4/21/14
# Version 1.16
#
# -changed output to display text only instead of hexdump and made it easier to read
# -added option to specify number of times to connect to server (to get more data)
# -added option to send STARTTLS command for use with SMTP/POP/IMAP/FTP/etc...
# -added option to specify an input file of multiple hosts, line delimited, with or without a port specified (host:port)
@Yardanico
Yardanico / bench.txt
Last active March 4, 2017 19:23
Python Hug http (runner.sh) benchmark
I changed number of requests from 20,000 to 100,000 to have enough time for PyPy3 to warm-up
PyPy3 results:
Python 3.5.2 (2b8db666aa18, Mar 04 2017, 02:00:12)
[PyPy 5.6.0-alpha0 with GCC 4.8.2] on linux
hug_test:
Requests per second: 22699.22 [#/sec] (mean)
Complete requests: 100000
falcon_test:
Requests per second: 23432.88 [#/sec] (mean)
include base
import random, sequtils
randomize()
proc call*(api: VkApi, msg: Message) =
let args: seq[string] = msg.cmd.arguments
import json, httpclient, queues
# We export all types and fileds from there to other modules
type
LongPollData* = object
key*: string
server*: string
ts*: int
Flags* {.pure.} = enum
@Yardanico
Yardanico / nimgame.nim
Created July 25, 2017 20:28
Nim game ported from Python:
{.noforward: on.}
import math, strutils
type
NimGame = ref object
players: seq[string]
board: seq[int]
proc initGame(): NimGame =
{.noforward: on.}
import math, strutils
type
NimGame = ref object
players: seq[string]
board: seq[int]
proc initGame(): NimGame =