Skip to content

Instantly share code, notes, and snippets.

Avatar

Pavel Kulyov pkulev

View GitHub Profile
View db.ml
(* A phone number is a sequence of four integers. *)
type phone_number = int * int * int * int;;
(* A contact has a name and a phone number. *)
type contact = {
name : string;
phone_number : phone_number
};;
(* Here is a dumb contact. *)
View keybase.md

Keybase proof

I hereby claim:

  • I am pkulev on github.
  • I am pkulev (https://keybase.io/pkulev) on keybase.
  • I have a public key ASDtmt6Ak8BNbWiJk6NoQooz07HBpdpAhm0VHmd-4Hft4Ao

To claim this, I am signing this object:

View .gitconfig
[user]
name = Pavel Kulyov
email = pkulev@croc.ru
[core]
editor = "emacs -nw"
diff = auto
status = auto
branch = auto
interactive = auto
excludesfile = /home/pkulev/.gitignore
View .zshrc
# Path to your oh-my-zsh installation.
export ZSH=/home/pkulev/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="obraun"
# Uncomment the following line to use case-sensitive completion.
View omp2.py
#!/usr/bin/env python
from OpenGLContext import testingcontext # noqa
from OpenGLContext.arrays import array
from OpenGL.arrays import vbo
from OpenGL.GL import (
shaders,
glEnableClientState,
glDisableClientState,
glDrawArrays,
View dataframe.py
"""Data frame for convinient work and renderings multipage data."""
import math
class DataFrame(list):
"""Data represents as granulated list of lists.
DataFrame is a list, thus you can access elements directly like
with original list structure: dataframe[index] -> element
Also you can granulate (more than once) list of frames by frame length
View nor.py
>>> def normalize(vector):
... normalized = []
... for elem in vector:
... normalized.append(elem / 255.)
... return normalized
...
>>> normalize((1,2,3))
[0.00392156862745098, 0.00784313725490196, 0.011764705882352941]
>>> normalize((0, 0, 0))
[0.0, 0.0, 0.0]
View omg.py
#!/usr/bin/env python
"""Just for fun."""
import sys
from OpenGL.GL import (
glClear,
glClearColor,
glRotatef,
View sim.py
#!/usr/bin/env python
import random
try:
ask = raw_input
except NameError:
ask = input
View parapapapa.c
#include <stdio.h>
#include <stdlib.h>
int pow2(int val)
{
return val * val;
}
int* map(int (*func)(int), int *arr, int len)
{