Skip to content

Instantly share code, notes, and snippets.

View Snugug's full-sized avatar

Sam Richard Snugug

View GitHub Profile
<?php
function swap(array &$array, $k1, $k2) {
$temp = $array[$k1];
$array[$k1] = $array[$k2];
$array[$k2] = $temp;
}
function partition(array &$array, $left, $right, $pivot) {
$pValue = $array[$pivot];
@scottkellum
scottkellum / about.md
Last active December 10, 2015 00:38 — forked from mirisuzanne/about.md

About This Proposal

This is a very rough proposal for a radical Susy 2.0 API overhaul.

The basic goals are:

  1. Flexible: Allow all the main layout approaches.
  • float / isolation
  • columns (symmetrical & asymmetrical) / fractions / explicit widths
  • gutters inside or outside - before, after, or split
@nathansmith
nathansmith / percentage_grid.sass
Created December 30, 2011 19:24
Percentage Based "Grid"
// How I would approach a fluid grid:
//
// [1] Let the name reflect the % width,
// eliminating "1 of 12" guesswork.
//
// [2] Also, put 10px of padding to either
// side, to stack and make a 20px gutter.
//
// [3] Make the box-sizing = border-box, so that
// 50% + 20px total side padding = 50%, etc.
@chriseppstein
chriseppstein / 0_selector_hacks.scss
Created September 14, 2011 04:27
This gist demonstrates some uses of the new sass feature: Passing content blocks to mixins.
@mixin ie6 { * html & { @content } }
#logo {
background-image: url("/images/logo.png");
@include ie6 { background-image: url("/images/logo.gif"); }
}
@mirisuzanne
mirisuzanne / reference.mkdn
Created August 22, 2011 23:34
Susy 0.9 Reference Documentation

Susy 0.9 Reference Documentation

See the official Susy site for 1.0 documentation.

Terms

  • Susy Grid: A grid that you build with Susy. You can have multiple on one page if you need.
  • Grid Element: Any HTML element that is aligned to a Susy Grid.
  • Container: The root element in a Susy Grid. Anything inside it is a potential Grid Element.
@nathos
nathos / twitterbutton.sass
Last active September 26, 2015 18:17
Scalable twitter button
.twitterbutton
// change size to any (reasonable) percentage/px you want
// font-size: 200%
color: #4e839e
font-family: "Helvetica Neue", Arial, sans-serif
font-weight: 300
line-height: 1em
text-decoration: none !important
text-rendering: optimizeLegibility
padding: 0.5em 0.7em

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