Skip to content

Instantly share code, notes, and snippets.

View alexeykudinkin's full-sized avatar

Alexey Kudinkin alexeykudinkin

  • San Francisco
View GitHub Profile
@cpcloud
cpcloud / decimalz.md
Created November 14, 2017 22:10
Decimals

Decimal Values in SQL-on-Hadoop

This document lays out the ways in which a few prominent SQL-on-Hadoop systems read and write decimal values from and to parquet files, and their respective in-memory formats.

Parquet's logical DECIMAL type can to be represented by the following physical types.

@chriseth
chriseth / snarktest.solidity
Last active December 3, 2023 07:03
zkSNARKs test code
// This file is MIT Licensed.
//
// Copyright 2017 Christian Reitwiessner
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O
@EKami
EKami / amazon_forest_notebook.ipynb
Last active March 16, 2021 02:07
Planet: Understanding the Amazon deforestation from Space challenge
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@djerfy
djerfy / system_memorydump.py
Created April 23, 2017 07:05
Python | Memory Dump Process (with PID on argument)
#!/usr/bin/env python
import ctypes, re, sys
c_ptrace = ctypes.CDLL("libc.so.6").ptrace
c_pid_t = ctypes.c_int32
c_ptrace.argtypes = [ctypes.c_int, c_pid_t, ctypes.c_void_p, ctypes.c_void_p]
def ptrace(attach, pid):
op = ctypes.c_int(16 if attach else 17)
@karpathy
karpathy / min-char-rnn.py
Last active April 26, 2024 11:55
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@molnarg
molnarg / angularjs-sandbox-escape.md
Last active August 3, 2017 08:46
An AngularJS Template Expression Sandbox Escape

An AngularJS Template Expression Sandbox Escape

Short Proof of Concept

<!doctype html>
<html>
trait RankN {
type TransformRank1[CC[X]] = CC ~> CC
type TransformRank0[CC[X]] = CC[_] => CC[_]
def liftRank[CC[X]](f: TransformRank0[CC]): TransformRank1[CC] =
new TransformRank1[CC] {
def apply[A](x: CC[A]): CC[A] = f(x).castTo[CC[A]]
}
}