Skip to content

Instantly share code, notes, and snippets.

@salipro4ever
salipro4ever / Parser.php
Created April 13, 2017 06:39
Fuelphp - Allow Lex parser execute with $data
<?php
/**
* Part of the Lex Template Parser.
*
* @author Dan Horrigan
* @license MIT License
* @copyright 2011 - 2012 Dan Horrigan
*/
namespace Lex;
@salipro4ever
salipro4ever / bootstrap.php
Created February 23, 2017 04:02 — forked from vitalyrotari/bootstrap.php
Language support for FuelPHP
/**
* app/bootstrap.php
*/
Autoloader::add_classes(array(
// Add classes you want to override here
// Example: 'View' => APPPATH.'classes/view.php',
'Uri' => APPPATH.'classes/uri.php',
'LayoutHelper' => APPPATH.'classes/layouthelper.php',
));
@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});
@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 / 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; }
});
/**
* 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));
}
public static function convert_Number_To_Words($number) {
$hyphen = '-';
$conjunction = ' and ';
$separator = ', ';
$negative = 'negative ';
$decimal = ' point ';
$dictionary = array(
0 => 'zero',
1 => 'one',
@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ả
@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 / 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();