Skip to content

Instantly share code, notes, and snippets.

View curiositry's full-sized avatar

Curiositry curiositry

View GitHub Profile
@curiositry
curiositry / placeholder_styles
Created August 28, 2013 18:39
The code needed to style HTML5 input placeholder text.
::-webkit-input-placeholder { /* WebKit browsers */
color: #555;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #555;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #555;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
@curiositry
curiositry / text_selection_style
Created August 28, 2013 18:41
CSS to style selected text differently from how the OS/Browser displays it be default.
::-moz-selection {
background-color: #777;
color: #fff;
}
::selection {
background-color: #777;
color: #fff;
}
@curiositry
curiositry / CSS_headers_and_compression
Created August 28, 2013 18:44
For those using PHP as a CSS preprocessor, this snippet sets the headers and also enables gzipping.
<?php ob_start ("ob_gzhandler");
header("Content-type: text/css; charset: UTF-8");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
time() + $offset) . " GMT";
header($ExpStr);
?>
@curiositry
curiositry / gradient_line
Created August 28, 2013 18:47
A neat gradient line snippet. Dependent on flexbox_functions.php. You could use the straight flexbox code or some other alignment system.
.gradient_line{
<?php flexbox::align_items_center(); ?>
height: 1px;
background: black;
width: 100%;
background: -webkit-gradient(linear, 100% 100%, 0 0, from(white), to(white), color-stop(50%, black));
background: -moz-linear-gradient(left, #FFF 0%, #444 50%, #fff 100%);
background: -o-gradient(linear, 0 0, 100% 0, from(white), to(white), color-stop(50%, black));
clear:all;
}
@curiositry
curiositry / opentype_ligatures
Created August 28, 2013 18:48
Code to enable Opentype Ligatures. (See _opentype-features.scss for more options)
-moz-font-feature-settings: "liga=1, dlig=1";
-ms-font-feature-settings: "liga", "dlig";
-webkit-font-feature-settings: "liga", "dlig";
-o-font-feature-settings: "liga", "dlig";
font-feature-settings: "liga", "dlig";
@curiositry
curiositry / smooth_scroll.js
Created September 29, 2013 00:39
A handy smooth scroll snippet that requires no extra markup and breaks modals.
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
@curiositry
curiositry / url_slugger.php
Created December 5, 2013 21:09
A function to convert strings to SEO friendly URL slugs from www.cubiq.org
setlocale(LC_ALL, 'en_US.UTF8');
function toAscii($str, $replace=array(), $delimiter='-') {
if( !empty($replace) ) {
$str = str_replace((array)$replace, ' ', $str);
}
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
$clean = strtolower(trim($clean, '-'));
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
@curiositry
curiositry / position.scss
Created December 14, 2013 02:42
A Sass mixin I wrote to make CSS position declarations quicker to write.
@mixin pos($pos,$top,$right,$bottom,$left){
position: $pos;
@if $top {
top: $top;
} @if $right {
right: $right;
} @if $bottom {
bottom: $bottom;
} @if $left {
left: $left;
@curiositry
curiositry / _opentype-features.scss
Created March 4, 2014 05:51
A basic SASS mixin that makes OpenType features easier to work with on the web.
@mixin openTypeFeatures(
$discretionary,
$historical,
$proportional-nums,
$tabular-nums,
$oldstyle-nums,
$lining-nums,
$superscript,
$subscript,
$scientific-inferiours,
@curiositry
curiositry / testing.md
Last active August 29, 2015 14:00
This is a short summary to test the Anthologist summary method.

TITLE:Markdown;
DATE:June 2013;
::end::

Markdown Tutorial for UberWriter

I will try to give a short impressions on how I use markdown/pandocs capabilities to greatly reduce the time spent on formatting anything -- from websites to PDF Documents.

You can find a much more exhaustive documentation for all features pandoc offers on pandoc's help page: Link