Skip to content

Instantly share code, notes, and snippets.

View hsquareweb's full-sized avatar

Hassan Elhassan hsquareweb

View GitHub Profile
<?php
function custom_facetwp_pager( $output, $params ) {
$output = '';
$page = (int) $params['page'];
$total_pages = (int) $params['total_pages'];
// Only show pagination when > 1 page
if ( 1 < $total_pages ) {
@hsquareweb
hsquareweb / test.js
Last active December 12, 2016 20:26
FacetWP - Change arrows for FacetWP pagination
(function($) {
$(document).on('facetwp-loaded', function() {
$('.facetwp-page.first-page').html('First');
$('.facetwp-page.last-page').html('Last');
});
})(jQuery);
@hsquareweb
hsquareweb / gulpfile.js
Created November 16, 2015 20:13 — forked from torgeir/gulpfile.js
Example gulpfile.js
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
// create custom selector for external links
$.expr[':'].external = function(obj){
var $this = $(obj);
return !$this.is('[href^="mailto:"]') && !$this.is('[href^="javascript:"]') && (obj.hostname != location.hostname) && ($this.data('target') != "top");
};
// DOM is ready
$(function(){
// apply target="_blank" to each external link on the page
@hsquareweb
hsquareweb / _responsive-mixins.scss
Last active December 29, 2015 13:29
Mixins For Responsive Media Queries
// Layout widths
$bp-full: 1200px;
$bp-landscape: 1024px;
$bp-mobile: 767px;
$bp-portrait: 768px;
$bp-wide: 1400px;
$container-width: 1060px;
// Breakpoints
@mixin bp($point) {
@hsquareweb
hsquareweb / _gradients.css.scss
Last active December 25, 2015 19:49 — forked from thbar/_gradients.css.scss
Gradient Mixin
@mixin gradient($from, $to) {
/* fallback/image non-cover color */
background-color: $from;
/* Firefox 3.6+ */
background-image: -moz-linear-gradient($from, $to);
/* Safari 4+, Chrome 1+ */
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to));
@hsquareweb
hsquareweb / index.haml
Created October 12, 2012 20:27 — forked from anonymous/index.haml
CSS: Gradient Button for IE9
.button
hello!
@hsquareweb
hsquareweb / gist:2424772
Created April 19, 2012 23:04
jQuery: Placeholder Fallback For Modernizer
//Placeholders fallback
$(function() {
// check placeholder browser support
if (!Modernizr.input.placeholder) {
// set placeholder values
$(this).find('[placeholder]').each(function() {
if ($(this).val() == '') { $(this).val( $(this).attr('placeholder') ); }
});
// focus and blur of placeholders
$('[placeholder]').focus(function() {