Skip to content

Instantly share code, notes, and snippets.

View keltanas's full-sized avatar
🇷🇺
justice will be served

Ke7Tana5 keltanas

🇷🇺
justice will be served
  • Saint Petersburg
View GitHub Profile
<?php
# http://seyferseed.ru/ru/php/kastomnaya-strategiya-gerenatsii-id-v-doctrine-2.html#sthash.r0n7nj05.dpbs
print 'orig: 581a8775b67e88-ca53-8b4568' . PHP_EOL;
print 'comp: ' . uniqid('', false) . dechex(mt_rand(0, 0xF)) . '-' . dechex(getmypid()) . '-' . dechex(mt_rand(0, 0xFFFFFF)) . PHP_EOL;
@keltanas
keltanas / vkmixin.py
Created January 27, 2016 14:43 — forked from adilkhash/vkmixin.py
Vkontakte Oauth 2.0 Mixin
#!/usr/bin/env python
#
# Vkontatke OAuth 2.0 wrapper
# Copyright 2011, Adil Khashtamov [adil.khashtamov@gmail.com]
# http://khashtamov.kz
#
#
import logging
#!/bin/sh
# /etc/init.d/teamcity - startup script for teamcity
export TEAMCITY_DATA_PATH="/home/keltanas/.BuildServer"
#sudo -u keltanas
case $1 in
start)
echo "Starting Team City"
start-stop-daemon --start -c keltanas --exec /opt/TeamCity/bin/runAll.sh start
/**
* Configured View for jQGrig
* @author: Nikolay Ermin <keltanas@gmail.com>
*/
define("Keltanas/GridView", [
"jquery",
"underscore",
"backbone",
"jqgrid/jquery.jqGrid"
], function ($, _, Backbone) {
@keltanas
keltanas / RabbitSetupMQ.md
Created April 30, 2015 18:28
RabbitSetupMQ

Setup Rabbit MQ on Ubuntu

sudo nano /etc/apt/sources.list

add to end file

deb http://www.rabbitmq.com/debian/ testing main

add public key

@keltanas
keltanas / VatCalculatingService.php
Last active November 21, 2016 14:37
Vat calculating
<?php
use Money\Money;
/**
* Class VatCalculatingService
* Calculating VAT
*
* @see: http://www.achievertalk.com/achievertalkwp/2011/06/vat-in-your-young-enterprise-company/
*/
class VatCalculatingService
<?php
namespace Linkofy\CommonBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class Builder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
Это вставить например, в "верхняя часть сайта"
<a href="#" id="blind">Версия</a>
<script>
$(function(){
$('#blind') // ссылается на <a href="#" id="blind"></a>
.click(function(){
$('body').toggleClass('blind');
return false;

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related

// Шаг 1
function(){} // объявляем анонимную функцию
// Шаг 2
(function(){})(); // - объявляем и запускаем анонимную функцию
// Шаг 3
(function($){