Skip to content

Instantly share code, notes, and snippets.

@paulirish
paulirish / gist:366184
Created April 14, 2010 18:59
html5 geolocation with fallback.
// geo-location shim
// currentely only serves lat/long
// depends on jQuery
// doublecheck the ClientLocation results because it may returning null results
;(function(geolocation){
if (geolocation) return;
@mirisuzanne
mirisuzanne / _transform-v2.scss
Created November 5, 2010 21:15
compass transforms version 2
@import "shared";
// Transform -----------------------------------------------------------------
// Apply a transform sent as a complete string.
@mixin apply-transform(
$transform,
$threeD: false
) {
@if $threeD {
@include experimental(transform, $transform,
@thomasyip
thomasyip / apple_theme_boxflex.css
Created November 29, 2010 06:50
Boxflex for iPhone app pane
/**
* Extracted from: https://github.com/beedesk/jQTouch/commit/b5d2fc63fe15acba15c4e8eaafc0e128997f8484
*/
/* ============= from themes/apple/theme.css ============= */
#jqt > * {
-webkit-transform: translate3d(0,0,0);
-webkit-backface-visibility: hidden;
background: rgb(197,204,211) url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAABCAIAAACdaSOZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpiPHrmCgMC/GNjYwNSAAEGADdNA3dnzPlQAAAAAElFTkSuQmCC);
-webkit-user-select: ignore;
/* Stupid compass box-shadow mixin doesn't support multiple shadows... */
@mixin box-shadow-2($first, $second) {
$full: $first, $second;
@include experimental(box-shadow, $full, -moz, -webkit, -o, not -ms, not -khtml, official);
}
@mixin curl-effect-shadow($corner) {
z-index: -1;
position: absolute;
@garyharan
garyharan / _mixins.scss
Created May 5, 2011 15:46
Useful scss mixins (rounded corners, gradients, text-field, button)
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@antsa
antsa / hyphens.scss
Created August 23, 2011 07:33
Hyphens @mixin for Compass
// Provides a mixin to define hyphenation
//
// Requires Compass
//
// (http://blog.fontdeck.com/post/9037028497/hyphens)
// (http://www.w3.org/TR/css3-text/#hyphenation)
//
// $value - The hyphenation property value. One of "none", "manual", "auto" or "all"
//
// Example .scss:
@nathansmith
nathansmith / config.rb
Created August 29, 2011 21:00
Example config.rb file for Compass
preferred_syntax = :sass
http_path = '/'
css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
relative_assets = true
line_comments = true
# output_style = :compressed
@scottjehl
scottjehl / hideaddrbar.js
Created August 31, 2011 11:42
Normalized hide address bar for iOS & Android
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function( win ){
var doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){
@EtienneLem
EtienneLem / _utils.scss
Created September 16, 2011 13:24
Scss utils.
// Scss Utils
// @author EtienneLem
// CSS3 misc
@mixin rounded ( $radius, $prefix:'' ) {
@include prefixes(border-radius, $radius, $prefix);
}
@mixin box-shadow ( $value ) {
@include prefixes(box-shadow, $value);