Skip to content

Instantly share code, notes, and snippets.

View klen's full-sized avatar

Kirill Klenov klen

View GitHub Profile
// Push payload scheme
// JSON schema: http://json-schema.org/
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Push payload specification",
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/ping",
#!/bin/sh
#
# Kirill Klenov
# Oct 27, 2013
#
# Usage: Add it to your PATH and `git submodule-remove path/to/submodule`.
ROOT=$(git rev-parse --show-toplevel)
SUBMODULE_NAME=$(echo "$1" | sed 's/\/$//'); shift
test -z "$SUBMODULE_NAME" && echo "You should define path to submodule." 1>&2 && exit 1
@klen
klen / City.h
Created November 9, 2013 10:15
Objective C - tutorial
//
// City.h
// city
//
// Created by Kirill Klenov on 09.11.13.
// Copyright (c) 2013 Kirill Klenov. All rights reserved.
//
#import <Foundation/Foundation.h>
@klen
klen / Cell.h
Created November 9, 2013 12:17
Objective-C tutorial
//
// Cell.h
// Cell
//
// Created by Kirill Klenov on 09.11.13.
// Copyright (c) 2013 Kirill Klenov. All rights reserved.
//
#import <Foundation/Foundation.h>
#!/usr/bin/env python
import doctest
import itertools as it
import math
def divisor_generator(num):
"""
""" Project Euler problem #1. """
def problem():
""" Solve the problem.
If we list all the natural numbers below 10 that are multiples of 3 or 5,
we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
""" Project Euler problem #2. """
def problem():
""" Solve the problem.
By considering the terms in the Fibonacci sequence whose values do not
exceed four million, find the sum of the even-valued terms.
Answer: 4613732
@klen
klen / euler3.py
Last active August 29, 2015 13:57
""" Project Euler problem #3. """
def problem():
""" Solve the problem.
What is the largest prime factor of the number 600851475143 ?
Answer: 6857
""" Project Euler problem #4. """
import itertools as it
def problem():
u""" Solve the problem.
A palindromic number reads the same both ways. The largest palindrome made
from the product of two 2-digit numbers is 9009 = 91 * 99.
""" Project Euler problem #5. """
from fractions import gcd
def problem():
""" Solve the problem.
2520 is the smallest number that can be divided by each of the numbers
from 1 to 10 without any remainder.