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 / Version20140321190821.php
Created March 21, 2014 17:14
Enable/Disable foreign_key_checks for MySQL in doctrine migrations
<?php
/**
* Created by PhpStorm.
* User: morontt
* Date: 21.03.14
* Time: 19:08
*/
namespace Application\Migrations;
@morontt
morontt / GeniusController.php
Created May 8, 2014 09:15
Facepalm (current timestamp)
<?php
/**
* Created by PhpStorm.
* User: morontt
* Date: 08.05.14
* Time: 12:15
*/
namespace Ultrasoft\SuperBundle\Controller;
@morontt
morontt / z5_1.cpp
Created May 18, 2014 08:14
salazar 1
#include <iostream>
#include <ctime>
#include <stdlib.h>
using namespace std;
int main() {
int s[10];
int z;
int count = 0;
@morontt
morontt / z5_2.cpp
Created May 18, 2014 08:19
salazar 2
#include <iostream>
using namespace std;
int main() {
int s[10];
int z;
int count = 0;
char lett;
@morontt
morontt / f.cpp
Created May 18, 2014 10:27
salazar 3
#include <iostream>
#include <math.h>
using namespace std;
float F(float a, float b, float c, float x, bool is_int) {
float result;
if (x < 0.0 && b != 0.0) {
result = -1.0 * a * x * x + b;
@morontt
morontt / z5_3.cpp
Last active August 29, 2015 14:01
salazar 4
#include <iostream>
#include <fstream>
using namespace std;
int main() {
int s[10];
int z;
int count = 0;
ifstream in_stream;
@morontt
morontt / slug.php
Created May 22, 2014 12:33
example slug
<?php
namespace Puper\SuperBundle\Util;
class Slug
{
const CASE_ORIGIN = 1;
const CASE_LOWER = 1;
const CASE_UPPER = 2;
@morontt
morontt / security.yml
Created May 29, 2014 12:50
example security.yml
security:
encoders:
Xxx\UserBundle\Entity\User: sha512
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
main:
@morontt
morontt / LoginController.php
Created May 29, 2014 12:53
example LoginController
<?php
namespace Xxx\UserBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\HttpFoundation\Request;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class LoginController extends Controller
@morontt
morontt / login.html.twig
Created May 29, 2014 12:55
example login.html.twig
{% extends 'XxxBundle::layout.html.twig' %}
{% trans_default_domain 'questions' %}
{% block content %}
<div class="wrapper">
<div class="top-options">
<h1>Sing in</h1>
<p>
Use: