This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* CLONE */ | |
var regex = /^(.+?)(\d+)$/i; | |
var cloneIndex = $('.cloneme').length; | |
function clone(){ | |
$(this).parents('.form-element-group').find('.cloneme').eq(0).clone() | |
.appendTo('.form-element-group-repeater') | |
.attr("id", "cloneme" + cloneIndex) | |
.find("*") | |
.each(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lighten a colour | |
@function tint($color, $percentage) { | |
@return mix(white, $color, $percentage); | |
} | |
// Darken a colour | |
@function shade($color, $percentage) { | |
@return mix(black, $color, $percentage); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var sparklineLogin = function() { | |
$('#mysparkline').sparkline( | |
[ 42,52,63,12,18,23,45,78,92,87 ], | |
{ | |
type: 'line', | |
width: '100%', | |
height: '40px' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="countries"> | |
<option value="" selected>Select a country...</option> | |
<option value="AF">Afghanistan</option> | |
<option value="AL">Albania</option> | |
<option value="DZ">Algeria</option> | |
<option value="AS">American Samoa</option> | |
<option value="AD">Andorra</option> | |
<option value="AO">Angola</option> | |
<option value="AI">Anguilla</option> | |
<option value="AQ">Antarctica</option> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add to your WP functions file | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); //Remove emojis introduced by WP 4.2 | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); //Remove emojis introduced by WP 4.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HiServices.framework/Versions/A/Resources/cursors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.toggle').click(function() { | |
var txt = $(this).next('ol').is(':visible') ? '+' : '-'; | |
$(this).find('span').text(txt); | |
$(this).next('ol').slideToggle(); | |
}); | |
<h3 class="toggle">Header <span>-</span></h3> | |
<ol> | |
<li>Option 01</li> | |
<li>Option 02</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function include_post_types_in_search($query) { | |
if(is_search()) { | |
$post_types = get_post_types(array('public' => true, 'exclude_from_search' => false), 'objects'); | |
$searchable_types = array(); | |
if($post_types) { | |
foreach( $post_types as $type) { | |
$searchable_types[] = $type->name; | |
} | |
} | |
$query->set('post_type', $searchable_types); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{QUERY_STRING} ^id=([0-9]*)$ | |
RewriteRule ^news/article\.php$ /news/? [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$conn = mysqli_connect('localhost','user','pw') or die(mysqli_error()); | |
$db=mysqli_select_db($conn,'database') or die(mysqli_error()); | |
$filename = 'filename-' . date("d-m-Y") . '.csv'; | |
header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' ); | |
header( 'Content-Description: File Transfer' ); | |
header( 'Content-type: text/csv' ); | |
header( "Content-Disposition: attachment; filename={$filename}" ); |