Skip to content

Instantly share code, notes, and snippets.

View jakebresnehan's full-sized avatar
👋

Jake Bresnehan jakebresnehan

👋
View GitHub Profile
@jakebresnehan
jakebresnehan / rgbaa.scss
Created September 19, 2012 09:19 — forked from KuraFire/rgbaa.scss
More dynamic, oldIE-compatible SCSS function for rgba
@function rgbaa($args...) {
// rgbaa(#FFF, .5)
@if length($args) == 2 {
$hex: nth($args, 1);
$alpha: nth($args, 2);
@if $oldIE == 1 {
@return rgb(red($hex), green($hex), blue($hex));
} @else {
@return rgba(red($hex), green($hex), blue($hex), $alpha);
@jakebresnehan
jakebresnehan / _settings.sass
Created August 29, 2012 13:05 — forked from nickawalsh/_settings.sass
Style Debugging
%debug
background-color: pink !important
@jakebresnehan
jakebresnehan / gist:3409430
Last active October 9, 2015 00:08
Sublime Text Settings
{
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"draw_minimap_border": true,
"draw_white_space": "all",
"font_face": "SourceCodePro-Regular",
"font_size": 14.0,
"file_exclude_patterns":
[
@jakebresnehan
jakebresnehan / RWD Screen Width Indicator
Created August 17, 2012 12:08 — forked from jordanmoore/RWD Screen Width Indicator
Current screen width indicator (useful for knowing when to add breakpoints when resizing browser window)
<script>
$(window).resize(function() {
var windowWidth = $(window).width();
$('.screen-width').text(windowWidth + 'px');
});
</script>
<div id="debug" style="position:fixed;padding:0.3em 0.6em;background:#f1f1f1;font-size:0.6em;bottom:0;left:50%;">
<span class="screen-width">0</span>
</div>
@jakebresnehan
jakebresnehan / dabblet.css
Created June 1, 2012 07:58 — forked from anonymous/dabblet.css
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
h1 span{
color:Red /* I only target <span> tags nested within a h1 */
}
h1 ~ span{
color:blue /* I dont taget <span> tags nest within a h1, but any <span> tag that follows a h1 on the same nested level */
@jakebresnehan
jakebresnehan / readme
Created May 27, 2012 23:47 — forked from jcobb/readme
Boilerplate Wordpress Widget
How to Use
Step 1.
Copy the custom_widget.php file and place it in your WordPress theme folder. Assuming WordPress is installed in the root of your server the file will be place in /wp-content/themes/yourtheme/
Step 2.
Open up functions.php and include the following piece of code somewhere in the file. include TEMPLATEPATH . '/custom_widget.php';
Step 3.
Edit the custom_widget.php file to suit your needs.
@jakebresnehan
jakebresnehan / clean-wordpress-custom-menus.php
Created May 4, 2012 01:26
Remove class and ID’s from Custom Menus
<?php
add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1);
add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);
add_filter('page_css_class', 'my_css_attributes_filter', 100, 1);
function my_css_attributes_filter($var) {
return is_array($var) ? array_intersect($var, array('current-menu-item')) : '';
}
?>
// http://wp-snippets.com/remove-class-and-ids-from-custom-menus/
@jakebresnehan
jakebresnehan / add-custom-post-type-to-feed.php
Created May 4, 2012 01:24
Add custom post type to feed
<?php
function myfeed_request($qv) {
if (isset($qv['feed']) && !isset($qv['post_type']))
$qv['post_type'] = array('post', 'snippets');
return $qv;
}
add_filter('request', 'myfeed_request');
?>
@jakebresnehan
jakebresnehan / gist:2425153
Created April 20, 2012 01:16 — forked from efedorenko/gist:2028193
Function for alpha blending
// Alpha blending
@function blend($bg, $fg) {
$r: red($fg) * alpha($fg) + red($bg) * (1 - alpha($fg));
$g: green($fg) * alpha($fg) + green($bg) * (1 - alpha($fg));
$b: blue($fg) * alpha($fg) + blue($bg) * (1 - alpha($fg));
@return rgb($r, $g, $b);
@jakebresnehan
jakebresnehan / contains-case-insensitive.js
Created April 3, 2012 00:41
Make jQuery :contains Case-Insensitive
//Code for overloading the :contains selector to be case insensitive:
//Without the overload on the :contains selector jquery would normaly only underline the second line
// New selector
jQuery.expr[':'].Contains = function(a, i, m) {
return jQuery(a).text().toUpperCase()
.indexOf(m[3].toUpperCase()) >= 0;
};
// Overwrites old selecor