Skip to content

Instantly share code, notes, and snippets.

View ahmetus's full-sized avatar

Ahmet Usal ahmetus

View GitHub Profile
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */
/* Default font size in pixels if not overridden. */
$baseFontSize: 16;
/* Convert PX units to EMs.
Ex: margin-right: pem(16);
*/
@function pem($pxval, $base: $baseFontSize) {
@return #{$pxval / $base}em;
# Server-Side jQuery testing with Node.js
# Copyright 2011 Benjamin Lupton
# MIT Licensed
# https://gist.github.com/1191942
# -------------------------------------
# Requires
fs = require('fs')
assert = require('assert')
doctype html
/[if lt IE 7]
html.no-js.ie6.oldie lang="en"
/[if IE 7]
html.no-js.ie7.oldie lang="en"
/[if IE 8]
html.no-js.ie8.oldie lang="en"
/[if gte IE 8]
html.no-js lang="en"
head
(($) ->
class Plugin
constructor: (@element, @settings) ->
console.log @element
@element.bind
'click' : @started
'blur' : @stopped
started: (e) => @settings.start.call @element, e
stopped: (e) => @settings.stop.call @element, e
$(document).ready ->
$('form').submit ->
$(this).find('.ajax-loader').show()
@ahmetus
ahmetus / gist:4380254
Created December 26, 2012 13:01 — forked from mfo/gist:857274
/*
info:
http://sass-lang.com/
group of css3pie mixins: http://css3pie.com/demos/tabs/
define browser compliant shortcut for:
- border-radius
- box-shaddow
*/
/*
desc: css3pie_box_shaddow apply a box-shaddow with css3pie 'framework'
$basefontSize : 12;
@mixin font-size_XXL{font-size:18 / $basefontSize * 100%;}
@mixin font-size_XL{font-size:16 / $basefontSize * 100%;}
@mixin font-size_L{font-size:14 / $basefontSize * 100%;}
@mixin font-size_S{font-size:10 / $basefontSize * 100%;}
@mixin opacity($opacity){
filter:alpha(opacity=$opacity*100);
opacity:$opacity;
}
@ahmetus
ahmetus / ie.md
Created December 26, 2012 13:04 — forked from rstacruz/ie.md

The IE cheatsheet

Only in IE7+

Selectors:

  • > (descendant)
  • [attr] (attribute)
  • .class1.class2 (multiple classes)
  • ~ (sibling)
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# cache.appcache needs re-requests
# in FF 3.6 (thx Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
@mixin pie
//using CSS3Pie for IE support
behavior: url(/PIE.htc)
.pie
@include pie
@mixin mybutton($bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor, $bordercolor, $textshadowcolor)
//this a mixin for general buttons with gradient background
@include vertical-gradient($bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4)