Skip to content

Instantly share code, notes, and snippets.

View beshur's full-sized avatar

Alex Buznik beshur

View GitHub Profile
@beshur
beshur / resize.js
Created February 3, 2014 10:40
javascript jQueryUI Resizable window resize bug fix (jQuery)
// fix jqueryui resizable bug:
//
// jqueryui resizable on 'resize' event invokes
// window.resize event, which maybe unwanted behaviour sometimes
//
window.onresize = function(event) {
if (typeof event.target.getAttribute === 'function')
return;
};
@beshur
beshur / al.php
Created March 19, 2014 09:57
php Yii attributeLabels example
<?php
class Profile extends CActiveRecord
{
public function attributeLabels()
{
return array(
'id' => Yii::t('model', 118),
'from' => Yii::t('model', 119),
'email' => Yii::t('model', 120),
'user_id' => Yii::t('model', 121),
@beshur
beshur / gist:9951830
Created April 3, 2014 10:00
laravel error tmp
<?php
App::error(function(Exception $exception, $code)
{
Log::error($exception);
// Save data to the database
$getUser = '';
// ....
@beshur
beshur / httpd-vhosts.conf
Created May 27, 2014 12:01
temp virtual host for family.beetroot
# Virtual Hosts
#
<VirtualHost *:80>
DocumentRoot "c:\wamp\www\family-beetroot"
ServerName family_br.loc
</VirtualHost>
@beshur
beshur / checkboxize.css
Last active August 29, 2015 14:01
jQuery Simple checkbox javascript after styling
.e_checkbox,
.e_radiobox {
position: relative;
display: inline-block;
width: 17px;
height: 17px;
margin-right: 5px;
}
<?php
/**
* Define type of server
*
* Depending on the type other stuff can be configured
* Note: Define them all, don't skip one if other is already defined
*/
define( 'DB_CREDENTIALS_PATH', dirname( ABSPATH ) ); // cache it for multiple use
@beshur
beshur / app.js
Created August 8, 2014 13:46
Javascript Express node-sass config
var express = require('express'),
// ... other packages
sass = require('node-sass');
// ...
var app = express();
// ...
// Commented this default express generator line:
// app.use(require('stylus').middleware(path.join(__dirname, 'public')));
//
@beshur
beshur / getNumeral.js
Created August 14, 2014 08:54
javascript Numerate endings Окончания на русском
/**
* original: http://pastebin.com/mnznDg7q
* by @grumblerbear
*
* Пример:
* 1, ['сайт', 'сайта', 'сайтов']
* Результат:
* 'сайт'
*
* Пример:
@beshur
beshur / .gitignore
Created September 8, 2014 08:44
wordpress .gitignore
# Ignore everything in the root except the "wp-content" directory..
/
/wp-config.php
/local-config.php
/remote-config.php
!.gitignore
!wp-content
wp-includes
wp-admin
wp-snapshots
@beshur
beshur / get.js
Created September 20, 2014 13:13
javascript get deep level of object
var data = {a: {b: 1}};
var type = {l1: "a", l2: "b"};
console.log("pos:", data[type.l1][type.l2]);