Skip to content

Instantly share code, notes, and snippets.

View nathos's full-sized avatar

Nathan Henderson nathos

View GitHub Profile
@davatron5000
davatron5000 / webperformant.htaccess
Created June 6, 2010 18:23
An .htaccess file for web performance and passing Page Speed and YSlow rules
# Enable GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</ifmodule>
# Expires Headers - 2678400s = 31 days
<ifmodule mod_expires.c>

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@mirisuzanne
mirisuzanne / animation.sass
Created April 24, 2011 16:18
find a new compass animation syntax
// Mixins --------------------------------------------------------------
=keyframes($name)
@-moz-keyframes #{$name}
@children
@-webkit-keyframes #{$name}
@children
@keyframes #{$name}
@chldren
.background_clip
// Seriously, why isn't this just the
// freakin' default in all browsers?
+background-clip(padding-box)
// Not sure what this does? Have a looksie...
// http://compass-style.org/examples/compass/css3/background-clip
// Crucial, if you have rounded corners on something with
// both background color and a border. Without, background
@olivierlacan
olivierlacan / cleverButton.css.sass
Created August 6, 2011 22:34
cleverButton Sass mixin for Compass
// ##### cleverButton #####
// # Version: 0.3
// # Description: Sass mixin for Compass to create fully styled buttons.
// # Notes: this mixin uses Compass mixin, see http://compass-style.org for
// # installation instructions.
// # Authors: Olivier Lacan, Andrew Smith
// ### changelog
// # v0.1: July 2010, initial version
// # v0.2: Added edge extendable edge styles
// # v0.3: Added Compass CSS3 mixins for reduced code & better browser support
@olivierlacan
olivierlacan / sublime-text-2-settings.json
Last active January 11, 2024 15:38
Basic Sublime Text 2 settings for Rails development
{
"use_simple_full_screen": false,
// calculates indentation automatically when pressing enter
"auto_indent": true,
// sets the colors used within the text area (default)
// see https://github.com/olivierlacan/monokaim to download
// the customized Monokai I use.
"color_scheme": "Packages/Color Scheme - Default/Monokaim.tmTheme",
@ravasthi
ravasthi / _config.yml
Created February 15, 2012 08:59
Multiple authors on Jekyll
authors:
hanzou:
name: Hanzou Hattori
display_name: Hanzou
gravatar: c66919cb194f96c696c1da0c47354a6a
email: hanzou@company.com
web: http://company.com
twitter: company
github: hhattori
jorgen:
@dakcarto
dakcarto / INFO_ee_forum_post.txt
Created March 10, 2012 03:28
Nginx 1.x Config for ExpressionEngine 2.x, with PATH_INFO and Adaptable HTTPS Support
This post is a report on my recent experiment getting EE to run well on a Nginx/PHP-FPM/PHP5.3.3+, no-Apache2 setup. I'm new to EE, but not server administration, with plenty of experience using Apache2.
However, after seeing the excessive RAM usage by Apache2 on my Ubuntu 10.04 LTS virtual server, (ve) @ MediaTemple.net , I wanted to look into deploying my first EE site on a more lightweight, but still robust setup, capable of scaling well. After working with EE for a bit, and finding out just how cool it is, I thought I'd share my results of trying this with Nginx 1.x.
The point of this post is to garner input from other EE server admins to refine these Nginx configs, with the hopeful outcome of generating, as much as possible, a 'config-and-drop-in' Nginx setup. While setting up current versions of Nginx and PHP-FPM are not within the scope of this posting...
[b]On Ubuntu 10.0.4[/b], you may want to check out:
@thulstrup
thulstrup / compass-retina-sprites.scss
Created March 20, 2012 19:18
Using Compass to generate normal and retina sprite maps
$sprites: sprite-map("sprites/*.png");
$sprites-retina: sprite-map("sprites-retina/*.png");
@mixin sprite-background($name) {
background-image: sprite-url($sprites);
background-position: sprite-position($sprites, $name);
background-repeat: no-repeat;
display: block;
height: image-height(sprite-file($sprites, $name));
width: image-width(sprite-file($sprites, $name));
@matthewmccullough
matthewmccullough / git-compressing-and-deltas.md
Created May 14, 2012 19:05
Git, Compression, and Deltas - An explanation

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo: