Skip to content

Instantly share code, notes, and snippets.

Rasmus Thulstrup thulstrup

Block or report user

Report or block thulstrup

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@micahgodbolt
micahgodbolt / SassMeister-input.scss
Created Jun 24, 2013
Another stab at Filament Group's Element Query challenge.
View SassMeister-input.scss
// ---
// Sass (v3.2.9)
// ---
@mixin respond-to($queries...) {
$length: length($queries);
@for $i from 1 through $length{
@if $i % 2 == 1 {
@media screen and (min-width: nth($queries, $i)) {
View 0_namespacing.scss
mymodule {
@at-root {
.#{&}-header { ... }
.#{&}-footer { ... }
.#{&}-body {
a { ... }
span { ... }
p { ... }
}
}
@ddemaree
ddemaree / _retina.scss
Created Apr 26, 2013
Example Sass mixin for a "bulletproof" Hi-DPI media query
View _retina.scss
@mixin retina($ratio: 1.5) {
$dpi: $ratio * 96;
$opera-ratio: $ratio * 100;
@media only screen and (-webkit-min-device-pixel-ratio: #{$ratio}),
only screen and ( -o-min-device-pixel-ratio: '#{$opera-ratio}/100'),
only screen and ( min-resolution: #{$dpi}dpi),
only screen and ( min-resolution: #{$ratio}dppx) {
@content;
}
@antsa
antsa / mq.scss
Last active Mar 2, 2019
Media Query mixin - @MQ
View mq.scss
// A mixin for media queries: @mq
//
// Use with keywords in $medias array:
// @include mq($media: iphone) {
// ...
// }
//
// Use with manual queries:
// @include mq("all and (min-width:33em)") {
// ...
@KuraFire
KuraFire / rgbaa.scss
Created Sep 13, 2012
More dynamic, oldIE-compatible SCSS function for rgba
View rgbaa.scss
@function rgbaa($args...) {
// rgbaa(#FFF, .5)
@if length($args) == 2 {
$hex: nth($args, 1);
$alpha: nth($args, 2);
@if $oldIE == 1 {
@return rgb(red($hex), green($hex), blue($hex));
} @else {
@return rgba(red($hex), green($hex), blue($hex), $alpha);
@soffes
soffes / perferences.json
Created Aug 22, 2012
My Sublime Text 2 config
View perferences.json
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".gitkeep",
"dump.rdb"
],
@simX
simX / hidpi.txt
Created Jul 28, 2012
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
View hidpi.txt
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.
@madrobby
madrobby / gist:3161015
Created Jul 22, 2012
Detect retina support. Tested on iOS, Android 2.x, Chrome for Android, Safari on MacBook Pro Retina, Firefox mobile (beta) for Android, Opera Mobile (Android)
View gist:3161015
function isRetina(){
return (('devicePixelRatio' in window && devicePixelRatio > 1) ||
('matchMedia' in window && matchMedia("(min-resolution:144dpi)").matches))
}
@jimmynotjim
jimmynotjim / more-mute-regex.md
Created Jul 19, 2012 — forked from imathis/tweetbot-mute-regex.md
Tweetbot can use regular expressions to mute tweets in your timeline and mentions.
View more-mute-regex.md

##Simply annoying Tweets

Annoyingly extended words (4+ of the same letter in a phrase): OOOOHHHHMMMMYYYYGGGGOOOODDDD

([a-z])/1{4}

Tweet w/ just a single hashtag: #omgthissucks

^ *#[^ ]+$
View demo.html
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="ie ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="ie ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="ie ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="ie ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
You can’t perform that action at this time.