Skip to content

Instantly share code, notes, and snippets.

View tylersticka's full-sized avatar

Tyler Sticka tylersticka

View GitHub Profile
@tylersticka
tylersticka / styles.css
Created December 9, 2022 18:01
Mastodon Advanced View: Highlight Missing Alt Text
.media-gallery__item-thumbnail:has(img:not([alt])) {
position: relative;
}
.media-gallery__item-thumbnail:has(img:not([alt]))::after {
align-items: center;
background: rgb(191, 64, 64);
border-radius: 4px;
color: #fff;
content: 'No alt';
@tylersticka
tylersticka / comments.php
Created January 6, 2012 01:06
Sample WP comments file
<?php if ( have_comments() || comments_open() ) : ?>
<section id="comments"<?php if ( ! comments_open() ) : ?> class="comments-closed"<?php endif; ?>>
<?php if ( have_comments() ) : ?>
<header class="visuallyhidden">
<h3>Responses</h3>
</header>
@tylersticka
tylersticka / Terminal.sublime-settings
Created May 11, 2012 01:56
Sublime Text Terminal settings for Mintty
{
"terminal": "C:/cygwin/bin/mintty.exe",
// The first and third commands make sure your bin comes through
// The second one prevents a directory change to home
"parameters": ["/bin/env", "CHERE_INVOKING=1", "/bin/bash", "-l"]
}
@tylersticka
tylersticka / gist:2045067
Created March 15, 2012 16:21
Simpler IE fixes with conditional comments and LESS

Simpler IE fixes with conditional comments and LESS

This assumes that you're using conditional comments on the html tag to define classes for certain versions of IE. This technique was originally proposed by Paul Irish and refined in the HTML5 Boilerplate to something like this:

<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

You can omit the "no-js" class if you aren't using Modernizr, and feel free to remove or tweak the conditional comments to suit the versions of IE that actua

@tylersticka
tylersticka / scrollable.scss
Created July 19, 2013 22:03
A class I sometimes use in my SASS/SCSS projects to add native-style scrolling to a fixed container in mobile or hybrid-mobile web apps.
// Native scrolling (iOS 5+, Android 4+)
.scrollable {
overflow: auto; // Fallback for non-touch browsers
-webkit-overflow-scrolling: touch; // Native-esque scrolling on touch-enabled webkit
// Everything below here improves performance of scrolling. You can omit this at
// first and add as your content becomes more complex and performance needs a boost.
&, > * {
-webkit-backface-visibility: hidden;
/**
* fitvids.js is awesome but kind of dependent on pretty
* ideal and predictable markup. Unfortunately, a lot of
* services and sites seem to break it.
*
* This is a dirtier but more forgiving spin on the same
* idea. It is probably worse, but it works.
*
* https://gist.github.com/tylersticka/5967626
*/
@tylersticka
tylersticka / ko.bindingHandlers.transitionEnd.js
Created May 3, 2013 04:06
Rough transitionEnd binding for Knockout
/*
* Sample usage:
* <div data-bind="transitionEnd: modelMethod"></div>
*
* Issues:
* - Webkit-only event name
* - Fires multiple times when multiple properties are transitioned
*/
ko.bindingHandlers.transitionEnd = {
init: function (element, valueAccessor) {
function partial(names) {
var hbs = require('hbs')
, fs = require('fs');
if (typeof names == 'string') names = [names];
names.forEach(function(name){
hbs.registerPartial(name, fs.readFileSync(__dirname + '/../views/partials/' + name + '.hbs', 'utf-8'));
});
}
@tylersticka
tylersticka / config.rb
Created July 13, 2012 15:34 — forked from erikjung/config.rb
Testing Compass Vertical Rhythm Loveliness
http_path = "/"
css_dir = ""
sass_dir = ""
images_dir = ""
javascripts_dir = ""
output_style = :expanded
line_comments = false
preferred_syntax = :scss
@tylersticka
tylersticka / gist:2891844
Created June 7, 2012 21:56 — forked from gyndav/gist:1883439
Skip iPhone URL bar
(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)) && !location.hash && setTimeout(function(){
!pageYOffset && window.scrollTo(0,1);
}, 1000);