Skip to content

Instantly share code, notes, and snippets.

@maxviewup
maxviewup / Foo.php
Created Jan 10, 2018
PHP Singleton Class
View Foo.php
// simple singleton instance getter - one line
Class Foo {
private static $instance = null;
public static function get_instance() {
return self::$instance ?: self::$instance = new self;
}
// ...class code
}
@maxviewup
maxviewup / SassMeister-input.scss
Last active Jul 26, 2017
SASS/SCSS #at-root and #selector-unify examples
View SassMeister-input.scss
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Class component
.component{
color:red;
@at-root section#{&} {
color:blue;