Skip to content

Instantly share code, notes, and snippets.

@BPScott
BPScott / classname_minification.md
Last active August 29, 2015 14:01
Investigating CSS Classname minification

Investigating CSS Classname minification

I saw a twitter conversation today making reference to performance savings based on minifying classnames, like what Google's GWT does.

I reckoned that the number of bytes saved would be negligble and thus this technique is not worth the hassle of implementing.

I should probably put that claim to the test...

@BPScott
BPScott / SassMeister-input.scss
Created February 27, 2015 15:38
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
$some-list: (item1, item2, item3);
@mixin someMixin($first, $second, $third) {
.mixin-variables-proving-the-mix-ca{
content: '#{$first}, #{second} #{third}';
}
@BPScott
BPScott / SassMeister-input.scss
Created February 27, 2015 15:46
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
$some-list: (item1, item2, item3);
@mixin someMixin($first, $second, $third) {
/* Should have content: 'item1, item2, item3'; */
.prove-the-mixin-can-access-its-args{
content: '#{$first}, #{$second} #{$third}';
@BPScott
BPScott / SassMeister-input.scss
Created June 20, 2015 14:55
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// An example of adding named ranges support to Sass-mq
@import "mq";
// These are the mq defaults but, we'll add them here
// so you can easily see what is going on
@BPScott
BPScott / SassMeister-input.scss
Last active August 29, 2015 14:23
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// An example of adding named aliases support to Sass-mq.
// Sass-mq is great for building out a single media query declaration. Much of
// the time though you don't use a declaration just once, you use it throughout
// your Sass codebase. Writing out potentially complex declarations multiple
// times may lead to mistakes, and if you need to change the query then you have
@BPScott
BPScott / SassMeister-input.scss
Created August 12, 2015 09:51
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// Sass is really dumb about creating literal backslashes, such as when
// creating codepoints for icon fonts.
// This works in LibSass 3.2 and Ruby Sass 3.4
@mixin icon-content($codepoint) {
content: #{"\"\\"}#{$codepoint + "\""};
@BPScott
BPScott / SassMeister-input.scss
Created August 13, 2015 10:12
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// Sass is really dumb about creating literal backslashes, such as when
// creating codepoints for icon fonts.
// This works in LibSass 3.2 and Ruby Sass 3.4
// Shamelessly pilfered from https://github.com/sass/sass/issues/659#issuecomment-71759457
@mixin icon-content($codepoint) {
@BPScott
BPScott / SassMeister-input.scss
Created September 20, 2015 11:59
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$items: (
small: 320,
medium: 600,
large: 1008
);
@BPScott
BPScott / readme.md
Created December 9, 2011 15:19
PHP on Heroku (please don't do this)

So Heroku's Cedar stack supports PHP but they're not exactly proud of it as it's not really mentioned anywhere apart from the Heroku & Facebook apps page

Try it out:

mkdir heroku-php
cd heroku-php
git init
heroku create --stack cedar

echo " index.php

@BPScott
BPScott / convert.rb
Created February 7, 2012 23:27
Fuckingawesomesongs.com songs object => one file per song
#Place in the root of your fuckingawesomesongs.com folder
#I convert the current contents of songs.rb into a one file per song structure
require 'YAML'
require_relative 'lib/songs'
def slugify string
string.downcase.gsub(/&/, 'and').gsub(/\s+/, '-').gsub(/[^a-z0-9-]/, '')
end
Songs.all.each do |song|