Skip to content

Instantly share code, notes, and snippets.

View emilbjorklund's full-sized avatar

Emil Björklund emilbjorklund

View GitHub Profile
@emilbjorklund
emilbjorklund / keybase.md
Created December 17, 2019 09:12
keybase.md

Keybase proof

I hereby claim:

  • I am emilbjorklund on github.
  • I am thatemil (https://keybase.io/thatemil) on keybase.
  • I have a public key ASCImOs6Q5NZWtyoW4N6j4eaSIrP0ogvI4IdO2-nbcQYJwo

To claim this, I am signing this object:

@emilbjorklund
emilbjorklund / index.html
Last active October 16, 2019 08:57
”Art directed” grid example
<div class="thing">
<img src="https://picsum.photos/seed/1/200" alt="">
<img src="https://picsum.photos/seed/2/200" alt="">
<img src="https://picsum.photos/seed/3/200" alt="">
<p>Grid layout! Here’s some text that goes on for a bit.</p>
<img src="https://picsum.photos/seed/4/200" alt="">
<img src="https://picsum.photos/seed/5/200" alt="">
</div>
#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." );
/* this... */
@supports media(min-width: 8sqlorps) {
@media (min-width: 8sqlorps) {
/* stuff */
}
}
/* ...would be the same as this... */
@media (min-width: 8sqlorps) {
/*! 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";
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(
@emilbjorklund
emilbjorklund / Pseudo-makefile
Last active January 21, 2020 22:27
Makefile for Sass?
# 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.
<!--
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.
-->
<!DOCTYPE html>
<html>
<head>
<style media="screen">
body {
margin: 0;
padding: 0;
}
/**
* 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);