Skip to content

Instantly share code, notes, and snippets.

return array(
'required' => "is required",
'equals' => "must be the same as '%s'",
'different' => "must be different than '%s'",
'accepted' => "must be accepted",
'numeric' => "must be numeric",
'integer' => "must be an integer (0-9)",
'length' => "must be longer than %d",
'min' => "must be at least %s",
'max' => "must be no more than %s",
@salipro4ever
salipro4ever / setup ormauth fuelphp.md
Last active February 25, 2016 15:44 — forked from asilbalaban/setup.md
How to install fuelphp and setup ormauth on it!

Installing and Setup FuelPHP's Ormauth

Create new project with Oil

$ oil create <project_name>

In your project there is a fuel/packages folder Copy /fuel/packages/auth/config/auth.php and /fuel/packages/auth/config/ormauth.php files to your main config folder which is /fuel/app/config/

@salipro4ever
salipro4ever / typingEffect
Created April 29, 2016 02:48
typingEffect
function loadNewsInteresting(){
typingEffect($('.index_news_interesting_lst').children('li.activated').children('a'),1);
}
function typingEffect(obj, opt){
var str = obj.text();
var allChar = str.length;
var count = 0;
var intervalTyping = null;
obj.html('').show();
@salipro4ever
salipro4ever / add time JS
Created June 15, 2016 09:27
add time JS
Date.prototype.addSeconds = function(seconds) {
this.setSeconds(this.getSeconds() + seconds);
return this;
};
Date.prototype.addMinutes = function(minutes) {
this.setMinutes(this.getMinutes() + minutes);
return this;
};
@salipro4ever
salipro4ever / gist:064870654b9d7b4fc63fd21d09c9e40f
Created August 23, 2016 16:16 — forked from thachpham92/gist:d57b18cf02e3550acdb5
Tất cả các tham số trong WP_Query
// Source: https://gist.github.com/luetkemj/2023628
// Xem hướng dẫn WP_Query toàn tập: http://goo.gl/kRpzTz
<?php
$args = array(
//////Author Parameters - Tham số lấy bài viết theo tác giả
//http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
'author' => '1,2,3,', //(int) - Các ID tác giả cần lấy bài viết (thêm dấu - vào để loại trừ tác giả, ví dụ: -14, -20)
'author_name' => 'luetkemj', //(string) - Lấy bài viết dựa theo tên nick name của tác giả
'author__in' => array( 2, 6 ), //(array) - Lấy bài dựa theo ID của tác giả
public static function convert_Number_To_Words($number) {
$hyphen = '-';
$conjunction = ' and ';
$separator = ', ';
$negative = 'negative ';
$decimal = ' point ';
$dictionary = array(
0 => 'zero',
1 => 'one',
/**
* Convert number string to number
* @param $num string 1,251.11
* @return numberic
*/
function reverse_number_format(&$num)
{
return $num = (float)str_replace(',', '', trim($num));
}
@salipro4ever
salipro4ever / navbar
Created December 2, 2016 06:39
Disable close navbar dropdown when click outside
$('.navbar-glaiz .navbar-nav > li').on({
"shown.bs.dropdown": function () {
this.closable = false;
},
"click": function () {
this.closable = true;
},
"hide.bs.dropdown": function() { return this.closable; }
});
@salipro4ever
salipro4ever / turn_off_spin
Created December 16, 2016 03:34
Turn Off Number Input Spinners
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
@salipro4ever
salipro4ever / gulp_copy_bower_files
Last active February 17, 2017 15:52
[Gulp] Example for web
var gulp = require('gulp'),
mainBowerFiles = require('main-bower-files'),
filter = require('gulp-filter');
gulp.task('default', [ 'bower']);
const jsFilter = filter(['**/*.min.js','LICENSE.txt'], {restore: true}); //LIST
//const jsFilter = filter('{**/*.min.js,**/LICENSE.txt}', {restore: true}); //OR
const mapFilter = filter('**/*.map', {restore: true});