Skip to content

Instantly share code, notes, and snippets.

Available for hire as Web Developer

Sovit Tamrakar ssovit

Available for hire as Web Developer
View GitHub Profile
ssovit / fontaweomse-stars.php
Last active Dec 19, 2018
Create FontAwesome static rating bar based on rating data
View fontaweomse-stars.php
function createFontAwesomeStarRating($rating=0,$min=0,$max=10,$maxStars=5,$return=false){
$score=(($rating - $min) * ($maxStars)) / ($max - $min) ;
$result='<div class="rating-stars" title="'.$score.'">';
$result.=str_repeat('<i class="fa fa-star"></i>',$full);
$result.=str_repeat('<i class="fa fa-star-half-o"></i>',$half);
$result.=str_repeat('<i class="fa fa-star-o"></i>',$empty);
ssovit / clear-cache.php
Created Sep 28, 2017
Auto clean autoptimize cache once a month
View clear-cache.php
namespace wppress;
class GarbageCollection
public function __construct()
add_filter('cron_schedules', function ($schedules) {
$schedules['weekly'] = array(
'interval' => 604800,
View svgPHPArray.js
var svgPHPArray = function (dest) {
var File = gutil.File;
var files = [];
var prepareFiles = function (f, enc, cb) {
if (f.isNull()) {
if (f.isStream()) {
ssovit / gulpfile.js
Created Sep 8, 2016
Gulp - Nicely Commented Less Import from a folder
View gulpfile.js
var gulp = require('gulp');
var less = require('gulp-less');
var lessImport=require('less-imports.js');
gulp.task('less_parts', function() {
View popular-post-class.php
class WPPress_Post_Views
function __construct() {
add_action('wp_ajax_post_heartbeat', array(&$this,
add_action('wp_ajax_nopriv_post_heartbeat', array(&$this,