This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Breakpoint detection test</title> | |
<style type="text/css" media="screen"> | |
@media screen and (min-width: 320px) { | |
#page:after { | |
content: 'smallest'; /* represent the current width-bracket */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Show a progress element for any form submission via POST. | |
Prevent the form element from being submitted twice. | |
*/ | |
(function (win, doc) { | |
'use strict'; | |
if (!doc.querySelectorAll || !win.addEventListener) { | |
// doesn't cut the mustard. | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Scalebar | |
* I need to rotate the image in place, without pushing content down or overlapping. | |
* Is there anyway to do this in CSS? | |
*/ | |
.wrap { | |
float: left; | |
} | |
.scalebar { | |
transform: rotate(-90deg); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style media="screen"> | |
body { | |
margin: 0; | |
padding: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Below is the exact code snippet IDG are recommending their clients to put on | |
every page of their site to enable retargeting. | |
Including quotes around the whole thing, which lots and lots | |
of people will add too. | |
Note: {NNNN} placeholders represent identifying numbers, | |
which I have removed and replaced with the {NNNN} parts in this example. | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is probably some pseudo-makefile syntax, but basically I want to do this: | |
# - The `assets/scss/` dir has a bunch of "top level" Sass files to | |
# be compiled - foo.scss, bar.scss etc. | |
# - Note: these files will each generate one resulting .css file of the | |
# same name as the source inside the build dir. foo.scss -> foo.css etc. | |
# - The build needs to be re-run any time any partial inside of a | |
# subdir in the scss folder changes: if `assets/scss/baz/_baz.scss` changes, | |
# I want to recompile all of the "root" .scss files. | |
# I.e. all of the partials in subdirs are prerequisites. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
popular_authors = list(Person.objects.published().annotate( | |
num_items=Count('newsitem__author')).order_by('-num_items')[:10]) | |
shuffle(popular_authors) | |
popular_authors = popular_authors[:2] | |
# The order_by clause in conjuncion with annotate seemed to | |
# get messed up here. So I switched to shuffle()-ing and slicing the list | |
# after evaluation instead. | |
other_authors = list(Person.objects.published().annotate( | |
num_items=Count('newsitem__author')).filter( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! Fixedfixed: a CSS position:fixed qualifier. Original by Filament Group. (c)2012 @scottjehl, Filament Group, Inc. Dual license: MIT and/or GPLv2 */ | |
(function( w, undefined ){ | |
var htmlclass = "fixed-supported", | |
el = w.document.createElement( "div" ), | |
ua = w.navigator.userAgent, | |
docEl = w.document.documentElement; | |
// fix the test element | |
el.style.position = "fixed"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* this... */ | |
@supports media(min-width: 8sqlorps) { | |
@media (min-width: 8sqlorps) { | |
/* stuff */ | |
} | |
} | |
/* ...would be the same as this... */ | |
@media (min-width: 8sqlorps) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#target Illustrator | |
/* | |
Revision-1 | |
Author: Shivendra Agarwal | |
Year: 2017 | |
Title: Script to scale-up artwork and artboard above 15 Mpixel | |
*/ | |
if ( app.documents.length > 0 ) | |
alert("ERROR: \n Close all documents before running this script." ); |
OlderNewer