Skip to content

Instantly share code, notes, and snippets.

View pascalduez's full-sized avatar

Pascal Duez pascalduez

View GitHub Profile
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Created April 14, 2014 07:51
Generated by SassMeister.com.
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
// Overengineering mixin output
// By caching values and on-the-fly generating placeholders
// Clever and crazy. I like it so far.
// ---

http://filippo.io/Heartbleed/ is a great service to the community.

I wouldn’t recommend testing hosts againt an online tool. All you do is create a log for a security savvy person with vulnerable hosts. While not quite the same, this is similar to uploading private keys or passwords to a service to check if they are secure.

Luckily it is easy to run the software locally, as the author was so kind to provide the source. I don’t read go very well, but a cursory glance suggests that the software does what it says on the tin, so we don’t worry about it phoning home.

This is the first time I’m building a go project, so I have to install go first. brew install go is easily done. You can get binary distributions for your OS from the go homepage: https://code.google.com/p/go/downloads/list

@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Created April 2, 2014 09:59
Generated by SassMeister.com.
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
// [Helper]
// Cast a stringified number to an actual number
// ---
// @param [string] $input: stringified number to cast
// ---
@chriseppstein
chriseppstein / generalized_memoizer.scss
Last active August 29, 2015 13:57
Memoization in Sass
// This approach lets you generically memoize any function by changing the call site:
@function something-slow-to-compute($arg-1, $arg-2) {
@return ... slow calculation ... ;
}
$cached-values: ();
@function cached($function-name, $args...) {
$cached-value: map-get($cached-values, ($function-name, $args));
@if $cached-value {
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active August 29, 2015 13:57
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
/// Deep set function to set a value in nested maps
/// @param {Map} $map - map
/// @param {List} $keys - list of keys to reach
/// @param {Literal} $value - value to assign
/// @return {Map}
@wookiecooking
wookiecooking / aliases.sh
Created November 30, 2013 00:52
[Shell] Assortment of OSX influenced bash aliases and functions
# Rails Stuff
alias stoprails='kill -9 $(lsof -i :3000 -t)'
alias startrails='rails server -d'
alias restartrails='stopRails && startRails'
#Check PHP For Erroes
alias phpcheck='find ./ -name \*.php | xargs -n 1 php -l'
# ROT13-encode text. Works for decoding, too! ;)
alias rot13='tr a-zA-Z n-za-mN-ZA-M'

How @extend Works

@akhleung is working on hcatlin/libsass and was wondering how @extend is implemented in the Ruby implementation of Sass. Rather than just tell him, I thought I'd write up a public document about it so anyone who's porting Sass or is just curious about how it works can see.

Note that this explanation is simplified in numerous ways. It's intended to explain the most complex parts of a basic correct @extend transformation, but it leaves out numerous details that will be important if full Sass compatibility

@JohnAlbin
JohnAlbin / _init.scss
Last active May 17, 2024 04:32
Handing IE8 and lower with Breakpoint + compass/support
// Initialize the Sass variables and partials used in this project.
// Set the legacy IE support variables. We override the default values set by
// the compass/support partial, but let styles-ie8.scss override these values.
$legacy-support-for-ie6 : false !default;
$legacy-support-for-ie7 : false !default; // Note the use of !default.
$legacy-support-for-ie8 : false !default;
// Partials to be shared with all .scss files.
@chriseppstein
chriseppstein / my_app_integration.rb
Created October 13, 2013 18:19
How to write your own application integration so that compass extensions can integrate with a custom application structure.
module MyAppIntegration
extend self
class Installer < Compass::Installers::ManifestInstaller
def completed_configuration
@completed_configuration ||= MyAppIntegration.configuration
end
# do special install stuff here
# like installing package manifests, etc.
@jakob-e
jakob-e / unitconversion.scss
Last active October 26, 2022 17:20
SCSS unit conversion functions
// ==========================================================
// Unit Conversion
// ==========================================================
//
// Functions:
// ----------------------------------------------------------
//
// NUMBER:
//
// isNaN($value) - returns true or false if type-of($value)==number