Skip to content

Instantly share code, notes, and snippets.

View SerafimArts's full-sized avatar
wazzup?

Kirill Nesmeyanov SerafimArts

wazzup?
View GitHub Profile
// by Erik Wrenholt
import java.util.*;
class Mandelbrot
{
static int BAILOUT = 16;
static int MAX_ITERATIONS = 1000;
private static int iterate(float x, float y)
{
import Vector2 from "/Core/Math/Vector2";
import Rotation from "/Core/Math/Rotation";
import {AClass, AProperty} from "/Core/Annotations/Meta";
@AClass('Basic Actor')
export default class Actor {
/**
* @type {boolean}
*/
class Test
constructor: (a, b) ->
console.log(a, b);
method: ->
# method
@method: ->
@SerafimArts
SerafimArts / gist:ad0b651cc23297db11fe
Created December 20, 2013 13:54
Yandex Disk WebDav
<?php
/**
* Зависимости:
* - Sabre: https://github.com/fruux/sabre-dav
* - Carbon: https://github.com/briannesbitt/Carbon
*
* Использование:
* $ya = new \Ya\Disk(base64_encode(LOGIN . ':' . PASSWORD));
* $wdc = $ya->getDisk();
* print_r($wdc->getDirectory('/'));
@SerafimArts
SerafimArts / gist:915dc8509f9cd6b9b612
Last active February 21, 2016 19:57
Яндекс: Задача на собеседование №3
/**
* Это феерическое безумие и полный разрыв
* мозга, по-этому я откомментирую ключевые моменты.
*
* Алгоритм фактически в лоб, просто перебор
* всех элементов, мозги и так плавятся =))))
*
* Пример:
* console.log(theMadness([1, 4, 6, 98, 3, 2, 7, 8, 90, 12, 8]));
* Возвращает массив комбинаций элементов, где каждый элемент бредставлен объектом
@SerafimArts
SerafimArts / gist:f6538436bd5b6cc7f00b
Last active February 21, 2016 19:57
Яндекс: Задача на собеседование №2
/**
* Вменяемый код
*
* Функция предоставляет вменяемый и расшираемый интерфейс
* для работы с требуемой функцией.
*
* Плюс такого подхода в чистоте кода и возможности
* для будущей поддержки без извращений (например
* логгирование, всякие другие плюшки, в том числе наследоваться).
*
<?php
/**
* This file is part of API package.
*
* @author Serafim <nesk@xakep.ru>
* @date 24.02.2016 16:23
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@SerafimArts
SerafimArts / HttpBus.php
Created March 1, 2016 18:57
Gitter api bus
<?php
/**
* This file is part of GitterAPI package.
*
* @author Serafim <nesk@xakep.ru>
* @date 01.03.2016 19:06
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@SerafimArts
SerafimArts / DoctrineCacheBridge.php
Created March 22, 2016 17:38
Laravel <=> Doctrine Cache adapter (bridge)
<?php
/**
* @author Serafim <nesk@xakep.ru>
* @date 22.03.2016 20:24
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Cache\Cache;
@SerafimArts
SerafimArts / Observable.js
Created September 29, 2015 12:45
ES Example (ES6 Symbol + ES7 Decorators + ES7 Object properties)
/**
* ObservablePrimitive instance
*/
class ObservablePrimitive {
/**
* @constructor
* @param value
*/
constructor(value = null) {
this.events = {