This file contains 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
txtblk='\e[0;30m' # Black - Regular | |
txtred='\e[0;31m' # Red | |
txtgrn='\e[0;32m' # Green | |
txtylw='\e[0;33m' # Yellow | |
txtblu='\e[0;34m' # Blue | |
txtpur='\e[0;35m' # Purple | |
txtcyn='\e[0;36m' # Cyan | |
txtwht='\e[0;37m' # White | |
bldblk='\e[1;30m' # Black - Bold |
This file contains 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
# change prompt | |
export PS1=$'\n\[\033[0;36m\]\u\[\033[0m\]: \[\033[1;33m\]\w\[\033[0m\] \n\xe2\x86\x92 ' |
This file contains 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
if(!Modernizr.svg) { | |
$('img[src$="svg"]').attr('src', function() { | |
return $(this).attr('src').replace('.svg', '.png'); | |
}); | |
} |
This file contains 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
['log', 'warn'].forEach(function(method) { | |
var old = console[method]; | |
console[method] = function() { | |
var stack = (new Error()).stack.split(/\n/); | |
// Chrome includes a single "Error" line, FF doesn't. | |
if (stack[0].indexOf('Error') === 0) { | |
stack = stack.slice(1); | |
} | |
var args = [].slice.apply(arguments).concat([stack[1].trim()]); | |
return old.apply(console, args); |
This file contains 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
query_posts( array( 'category__and' => array($cat_id), 'posts_per_page' => 1, 'orderby' => 'rand' ) ); | |
while (have_posts()) : the_post(); | |
// show stuff here | |
endwhile; | |
wp_reset_query(); |
This file contains 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
// ---- | |
// Sass (v3.3.8) | |
// Compass (v1.0.0.alpha.19) | |
// ---- | |
// _config.scss | |
$base-font-size: 16px; | |
$support-legacy: true; | |
@mixin rem($value, $base: $base-font-size) { |
This file contains 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
<!-- Twitter --> | |
<a href="https://twitter.com/home?status=Your%20custom%20tweet%20with%20blanks.">Share on Twitter</a> | |
<a href="https://twitter.com/home?status=Check%20out%20this%20article%20by%20@ikalli:%20<?php the_title(); ?> <?php the_permalink(); ?>">Share on Twitter</a> | |
<!-- Facebook --> | |
<a href="https://www.facebook.com/sharer/sharer.php?u=http://mydomain.com/articletitle">Share on Facebook</a> | |
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>">Share on Facebook</a> |
This file contains 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
<img src="small.jpg" srcset="small.jpg [smallwidth]w, large.jpg [largewidth]w" alt="Alt Text" /> |
This file contains 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($) { | |
$.fn.countTo = function(options) { | |
// merge the default plugin settings with the custom options | |
options = $.extend({}, $.fn.countTo.defaults, options || {}); | |
// how many times to update the value, and how much to increment the value on each update | |
var loops = Math.ceil(options.speed / options.refreshInterval), | |
increment = (options.to - options.from) / loops; | |
return $(this).each(function() { |
This file contains 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
$.fn.serializeObject = function() { | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); | |
} else { |