Skip to content

Instantly share code, notes, and snippets.

View othersmallcities's full-sized avatar
making things more accessible

Philipp Tautz othersmallcities

making things more accessible
View GitHub Profile
" Make IE Better Compatible "
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
======================================================
IE6 Only
==================
_selector {...}
@samsolomon
samsolomon / Create Random Number in Liquid
Last active September 30, 2019 02:52
This code will work to give you a random number to use in Liquid. Works in customer.io.
<!--create a semi-random number using the last second of the send date-->
{% capture time_seed %}
{{ 'now' | date: "%s" }}
{% endcapture %}
<!--manupulate using lots of maths-->
{% assign random = time_seed | times: 1103515245 | plus: 12345 | divided_by: 65536 | modulo: 32768 | modulo: 10 %}
<!--return number-->
{{ random }}
@hc2p
hc2p / icon-mixin
Last active August 16, 2018 08:37
dry icon mixin
$icons: (
follow: 'a',
followed: 'b',
unfollow: 'c',
checkmark: 'e'
);
$Placeholder-Selectors: ();
@mixin icon($name, $color, $extend: true) {
@include icon-static($extend);
@eprothro
eprothro / Compass Retina Spriting.md
Last active December 27, 2015 10:09
Sass sprite generation with compass for retina and non-retina images (example code for a Rails 3 application).

Overview

The below Sass+Compass/Ruby can be used to:

  • Generate retina and non-retina sprite maps
  • Allow a single style class to provide retina and non-retina support, per image
  • Automatically generate those sprite style classes

Example markup for a retina supported menu button:

%a.icon-hamburger
@morewry
morewry / _icons.scss
Created September 18, 2013 18:44
Compass sprites generate placeholders instead of classes (newer version doesn't require listfiles.rb)
$disable-magic-sprite-selectors: true;
$icons-inline: true;
$icons-sprite-base-class: "%icons-sprite";
$icons-layout: smart;
$icons: sprite-map("icons/*.png");
@import "icons/*.png";
@each $img in sprite-names($icons) {
%icon-#{$img} {
@extend %icons-sprite;
@joaocunha
joaocunha / How To Hide The Select Arrow On Firefox.md
Last active December 10, 2023 13:05
How to hide <select> dropdown's arrow in Firefox when using "-moz-appearance: none;".

This is no longer a bug. I'm keeping the gist for historical reasons, as it helped to get it fixed. Make sure to read the notes by the end of the post.

How to remove hide the select arrow in Firefox using -moz-appearance:none;

TL;DR (or, the fix)

  1. Set -moz-appearance to none. This will "reset" the styling of the element;
  2. Set text-indent to 0.01px. This will "push" the text a tiny bit[1] to the right;
@mixin image-2x($image, $width, $height) {
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
/* on retina, use image that's scaled by 2 */
background-image: url($image);
background-size: $width $height;
}
@MattWilcox
MattWilcox / wp-config.php
Created March 18, 2013 14:38
Bits to add to wp-config.php to make things sane when developing in a real development system (local > stage > live) instead of developing directly on a live server. Which is what WP is set up to do and which is ridiculous.
/* Lets not rely on paths in the database, they can be very wrong when moving between dev/stage/live environments */
/* The following two variables are backward to my thinking, but hey, what ya gonna do? */
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . ''); // This is NOT the 'wordpress admin area' home, but the site's home
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/SECRETDIRECTORY'); // This isn't the site's URL but the WordPress admin area URL
/* MySQL settings */
switch($_SERVER['SERVER_NAME']){
// Your local machine's settings
case 'mysite.local':
define('DB_NAME', 'dev_mysite');
/* normal flexbox */
.flexbox .flex-container {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: flex;
}
.flexbox .flex-container.vertical {
display: -webkit-flex;
display: -moz-flex;
@Wilto
Wilto / blockquote.md
Created December 20, 2012 15:35
Of Blockquotes and Outlines