Skip to content

Instantly share code, notes, and snippets.


Ayesh Karunaratne Ayesh

View GitHub Profile
jareware /
Last active Aug 4, 2021
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

aliang / Mac SSH Autocomplete
Created Jun 14, 2011
Add auto complete to your ssh, put into your .bash_profile
View Mac SSH Autocomplete
_complete_ssh_hosts ()
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
View safari-reaper.html
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
body {
View minimal-analytics-snippet.js
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
lyrixx / HardCoreDebugLogger.php
Last active Jul 8, 2021
Hardcore Debug Logger
View HardCoreDebugLogger.php
final class HardCoreDebugLogger
public static function register(string $output = 'php://stdout')
register_tick_function(function () use ($output) {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
macintux /
Last active Jun 21, 2021
Public speaking tips
kieranmv95 / _center.mixin.scss
Last active Apr 26, 2018
Center anything horizontally vertically or on both axis in scss
View _center.mixin.scss
// Center anything horizontally, vertically or both (assuming that the parents position is set to relative)
// Codepen Example Usage:
@mixin center($center: 'all') {
position: absolute;
@if $center == 'all' {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
mncaudill / php-quine.php
Created Dec 21, 2010
This is a PHP quine. When run, this program will print out an exact version of itself.
View php-quine.php
$data = array(
$nl = chr(10);
print "<?php$nl$nl\$data = array($nl";
foreach($data as $d) {