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 / LocaleListener.php
Created September 23, 2014 10:38
Locale Listener
<?php
/**
* Created by PhpStorm.
* User: morontt
* Date: 29.07.14
* Time: 0:32
*/
namespace PuperSoft\FrontendBundle\EventListener;
@morontt
morontt / controller.php
Created October 7, 2014 07:38
Preview action
<?php
class QuestionController extends BaseController
{
/**
* @param Request $request
* @return JsonResponse
*/
public function saveSessionAction(Request $request)
@morontt
morontt / temp.js
Created November 17, 2014 14:41
temp-js
$(function () {
var hotel_image = $('#hotelImage');
var current_index = 0;
var gal_height = 370;
var gal_width = 570;
var ratio = gal_width / gal_height;
function imageHandler(current_element, url) {
var image;
@morontt
morontt / setter.vm
Created December 25, 2014 12:54
PHP Setter Method
/**
* @param ${TYPE_HINT} $${PARAM_NAME}
#if (${STATIC} != "static")
* @return $this
#end
*/
public ${STATIC} function set${NAME}($${PARAM_NAME})
{
#if (${STATIC} == "static")
self::$${FIELD_NAME} = $${PARAM_NAME};
@morontt
morontt / LoadTagData.php
Created December 26, 2014 09:24
tags fixtures
<?php
namespace XtrCommunity\QuBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use XtrCommunity\QuBundle\Entity\Tag;
class LoadTagData extends AbstractFixture implements OrderedFixtureInterface
@morontt
morontt / atom_error.txt
Last active August 29, 2015 14:12
no description
script/build
Node: v0.10.33
npm: v1.4.10
Installing build modules...
Usage: gyp_main.py [options ...] [build_file ...]
gyp_main.py: error: no such option: --no-parallel
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 2
gyp ERR! stack at ChildProcess.onCpExit (/home/morontt/libs/atom/build/node_modules/npm/node_modules/node-gyp/lib/configure.js:340:16)
@morontt
morontt / a300-mount.sh
Last active August 29, 2015 14:13
mount mediaplayers
#!/bin/bash
# mount Popcorn Hour A300
# nfs
sudo mount -t nfs -o vers=3 192.168.1.69:/share ~/nfs/A300
@morontt
morontt / for-and-callback.js
Created February 24, 2015 12:36
for and callback
var t = [];
for (var i = 0; i < 43; i++) {
(function (idx) {
$.ajax({
data: data,
success: function (rez) {
t[idx] = rez;
}
});
})(i);
@morontt
morontt / .bash_profile
Created March 3, 2015 16:38
.bash_profile on Mac
export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql93/bin:/usr/local/go/bin:$PATH
source ~/.git-prompt.sh
export GOPATH=~/gocode
#color for terminal
export PS1="\[\e]0;\u@\h: \w\a\]\[\033[01;36m\]\u@\h \[\033[01;33m\]\w\[\033[33m\]\$(__git_ps1 ' git:(%s)')\n\[\033[01;35m\]\$ \[\033[00m\]"
source ~/.git-completion.bash
<VirtualHost *:80>
ServerName example.loc
ServerAlias www.example.com
DocumentRoot "/path/to/httpdocs/web"
ErrorLog "/path/to/logs/error.log"
CustomLog "/path/to/logs/access.log" common
<Directory "/path/to/httpdocs/web">
DirectoryIndex index.php index.html
Options FollowSymLinks