Skip to content

Instantly share code, notes, and snippets.

View cabans's full-sized avatar
:octocat:

Abel Cabans cabans

:octocat:
View GitHub Profile
@cabans
cabans / hidden-text.css
Created February 13, 2014 15:54
Hide text from human eyes
.hidden-text {
/* Kellum Replacement Method: http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement/ */
position: absolute;
text-indent: 100%;
height: 0;
white-space: nowrap;
overflow: hidden;
}
@cabans
cabans / last_and_first_month_day.php
Last active August 29, 2015 13:56
PHP: Last and First day of actual month
/** Actual month last day **/
function _data_last_month_day() {
$month = date('m');
$year = date('Y');
$day = date("d", mktime(0,0,0, $month+1, 0, $year));
return date('Y-m-d', mktime(0,0,0, $month, $day, $year));
};
/** Actual month first day **/
@cabans
cabans / css-media-queries-base.css
Created May 9, 2014 08:23
CSS Media queries Base
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@cabans
cabans / media-queries-base.css
Created May 9, 2014 08:28
CSS Media Queries Base
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
<?php
/*
Template Name: Reset Page
*/
get_header()
?>
<div class="wrapper">
<?php
@cabans
cabans / CSScomb.sublime-settings
Created July 16, 2015 09:44
Sublime Text - CSS Comb Settings
{
// Full list of supported options and acceptable values can be found here:
// https://github.com/csscomb/csscomb.js/blob/master/doc/options.md
"config": {
// Whether to add a semicolon after the last value/mixin.
"always-semicolon": false,
// Set indent for code inside blocks, including media queries and nested rules.
"block-indent": " ",
@cabans
cabans / is_mac.js
Created August 11, 2015 13:18
Check if OS is Mac OS X
// Check if OS client is Mac OS X
if(navigator.platform.match('Mac') !== null) {
$('body').addClass('macosx');
}
@cabans
cabans / Preferences.sublime-settings
Last active September 22, 2015 07:38
Sublime Text 3 Personal Settings
{
"always_show_minimap_viewport": true,
"atomic_save": true,
"auto_complete_selector": "source, text",
"bold_folder_labels": true,
"caret_extra_width": 0,
"caret_style": "phase",
"close_windows_when_empty": false,
"color_scheme": "Packages/User/SublimeLinter/Tomorrow-Night (SL).tmTheme",
"detect_indentation": false,
@cabans
cabans / fix_paged_homepage.php
Created September 27, 2012 09:34
Wordpress: Fix for loop pagination with Custom Post Type in homepage
<?php
//Fix homepage pagination
if ( get_query_var('paged') ) {
$paged = get_query_var('paged');
} else if ( get_query_var('page') ) {
$paged = get_query_var('page');
} else {
$paged = 1;
}
@cabans
cabans / clean-paragraphs.php
Last active November 18, 2015 16:46
WordPress - Clean paragraphs in Shortcodes
<?php
// Move priority of Auto Paragraph function
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 12);
// Shortcode function
function shortcode_function( $atts, $content ) {
// Clean spaces and add paragraphs
$content = wpautop(trim($content));