Skip to content

Instantly share code, notes, and snippets.

View morontt's full-sized avatar
🤖
Just for Fun

Alexander Kharchenko morontt

🤖
Just for Fun
View GitHub Profile
@morontt
morontt / Integrate.md
Last active January 17, 2016 21:07
integrate
  • Метод прямоугольников
  • Метод трапеций
  • Метод параболы
<?php
/**
* Created by PhpStorm.
* User: morontt
* Date: 29.07.14
* Time: 0:32
*/
namespace Avtogid\FrontendBundle\EventListener;
<?php
use App\Alien;
use Doctrine\DBAL\DBALException;
$entity = new Alien();
try {
$this->em->persist($entity);
$this->em->flush();
@morontt
morontt / FeatureContext.php
Last active September 25, 2015 08:50
wait
<?php
namespace Mega\TestBundle\Features\Context;
use Behat\Symfony2Extension\Context\KernelAwareInterface;
use Behat\MinkExtension\Context\MinkContext;
/**
* Feature context.
*/
@morontt
morontt / bruteforce-generator.py
Last active September 13, 2015 09:10
Битва прог, часть вторая
# author: Dmitriy Belyaev
# https://github.com/dimka2014
import itertools
numbers = set([x for x in range(1, 19)])
sequences = [x for x in itertools.combinations(numbers, 6)]
@morontt
morontt / Conkyrc
Last active August 29, 2015 21:57
own_window yes
own_window_class Conky
own_window_colour black
own_window_transparent no
own_window_argb_visual yes
own_window_argb_value 140
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_type dock
double_buffer yes
use_spacer right
@morontt
morontt / golden_section.py
Created June 25, 2015 21:20
Golden section search
#!/usr/bin/env python
import math
fi = (math.sqrt(5.0) + 1.0)/2
print 'epsilon: ',
eps = input()
print 'a: ',
@morontt
morontt / dump.sql
Created June 9, 2015 12:15
SQL query
CREATE TABLE IF NOT EXISTS `phone_call` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user` varchar(16) NOT NULL,
`flag` int(10) unsigned NOT NULL,
`length` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `phone_call` (`id`, `user`, `flag`, `length`) VALUES
(1, 'pupkin', 0, 12),
@morontt
morontt / queens.c
Last active August 29, 2015 14:21
Eight queens puzzle
#include <stdio.h>
#include <time.h>
#define SIZE 8
int pos[SIZE];
int used[SIZE];
int down(int line)
{
@morontt
morontt / app.js
Created April 7, 2015 12:48
twig.js inline template
var html = twig({ ref: "user-profile" }).render({
list: ["a", "b", "c"]
});