Skip to content

Instantly share code, notes, and snippets.

View yakovenkodenis's full-sized avatar
:octocat:

Denis Yakovenko yakovenkodenis

:octocat:
  • Ukraine, Kharkiv
View GitHub Profile
@yakovenkodenis
yakovenkodenis / rsa.py
Last active May 1, 2016 12:39
Simple RSA implementation that stores cipher array as a json string in base64.
import json
from random import randint
class RSA(object):
def __init__(self):
self.p, self.q = self.gen_p_q()
self.N = self.p * self.q
self.phi = self.euler_function(self.p, self.q)
@yakovenkodenis
yakovenkodenis / DES.py
Created May 1, 2016 09:21
DES algorithm that works with bit arrays and uses PKCS7 padding
import bitarray
import itertools
from collections import deque
class DES(object):
_initial_permutation = [
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
@ALF-er
ALF-er / Opinion.md
Last active April 29, 2020 21:16
ReactJS Conf 2016

Disclaimer 1: Первую которая "про то чего мы достигли" я таки пропустил.

Disclaimer 2: Многие доклады смотрелись и отчёты писались в состоянии алкогольного опьянения.

Сейчас посмотрел Ben Alpert - What Lies Ahead она про то какие идеи они имеют о дальнейшем развитии. И они делят на UX-идеи и DX-идеи. В UX у них:

@yakovenkodenis
yakovenkodenis / onetimepad.py
Created February 26, 2016 08:34
One Time Pad
import binascii
import itertools
def xor_strings(a, b):
return ''.join(
[chr(ord(x) ^ ord(y)) for x, y in zip(a, itertools.cycle(b))])
def xor_hex_strings(a, b):
@yakovenkodenis
yakovenkodenis / ceasar_cipher_and_cracker.py
Last active February 25, 2016 21:58
Encryptor, decryptor and cracker for the Ceasar cipher
import numpy as np
def cipher(text, alphabet='abcdefghijklmnopqrstuvwxyz', key=0):
result = ""
alphabet = alphabet.lower()
n = len(alphabet)
for char in text:
if char.isalpha():
new_char = alphabet[(alphabet.find(char.lower()) + key) % n]
@vsubhashini
vsubhashini / readme.md
Last active January 24, 2023 21:43
Sequence to Sequence - Video to Text (S2VT)
@chmarr
chmarr / blocked.sql
Created November 5, 2015 18:30
PostgreSQL query to display blocked and blocking queries. Updated from PG Wiki.
SELECT blocked_locks.pid AS blocked_pid,
blocked_activity.usename AS blocked_user,
now() - blocked_activity.query_start
AS blocked_duration,
blocking_locks.pid AS blocking_pid,
blocking_activity.usename AS blocking_user,
now() - blocking_activity.query_start
AS blocking_duration,
blocked_activity.query AS blocked_statement,
blocking_activity.query AS blocking_statement
@vsubhashini
vsubhashini / poolmean.prototxt
Last active February 22, 2021 03:30
Translating Videos to Natural Language Using Deep Recurrent Neural Networks
# The network is used for the video description experiments in [1].
# Please consider citing [1] if you use this example in your work.
#
# [1] S. Venugopalan, H. Xu, J. Donahue, M. Rohrbach, R. Mooney, K.Saenko.
# "Translating Videos to Natural Language using Deep Recurrrent Neural
# Networks." NAACL-HLT 2015.
name: "mean_fc7_to_lstm"
layer {
name: "data"
@kangax
kangax / quicksort.hs
Last active September 5, 2021 19:44
Haskell-inspired quick sort in ES6
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let smallerSorted = quicksort (filter (<=x) xs)
biggerSorted = quicksort (filter (>x) xs)
in smallerSorted ++ [x] ++ biggerSorted
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active July 5, 2025 14:15
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.