The mandelbrot algorithm in SCSS.
A Live example by Gregor Adams
The mandelbrot algorithm in SCSS.
A Live example by Gregor Adams
// ---- | |
// Sass (v3.4.6) | |
// Compass (v1.0.1) | |
// ---- | |
.button-base | |
background-color: #f0f0f0 | |
border-radius: 20px | |
border: 1px solid #ccc | |
color: #333 |
// ---- | |
// Sass (v3.4.7) | |
// Compass (v1.0.1) | |
// ---- | |
@function extract-keyword-arg($argname, $args...) { | |
$kwargs: keywords($args); | |
@return map-get($kwargs, $argname); | |
} |
require 'ignoring_diff' | |
Hash.send(:include, IgnoringDiff) | |
h = {:foo => :bar} | |
h.diff({}) | |
# => {:foo => :bar} | |
h.ignore_difference_for(:foo) | |
h.diff({}) | |
# => {} |
#include <nan.h> | |
#include "number.h" | |
#include "../create_string.h" | |
using namespace v8; | |
namespace SassTypes | |
{ | |
Number::Number(Sass_Value* v) : SassValueWrapper(v) {} |
. | |
├── assets | |
│ ├── images | |
│ │ ├── foo | |
│ │ │ └── image1.png | |
│ │ └── unused.gif | |
│ ├── js | |
│ │ └── app.js | |
│ └── scss | |
│ └── app.scss |
module Tracer | |
def trace(method) | |
method, ending = split_method_name(method) | |
define_method "#{method}_with_trace#{ending}" do |*arguments| | |
puts "called #{self.class}##{method}#{ending}(#{arguments.map(&:inspect).join(', ')})" | |
returning(send("#{method}_without_trace#{ending}", *arguments)) do |v| | |
puts "#{self.class}##{method}#{ending} => #{v.inspect}" | |
end | |
end | |
alias_method_chain "#{method}#{ending}", :trace |
.compass { margin: 1em auto; position: relative; width: 16em; height: 16em; font-size: 24px; font-family: "Academy Engraved LET", "Papyrus"; } | |
.compass .n, .compass .s, .compass .e, .compass .w { position: absolute; width: 4em; height: 4em; text-align: center; vertical-align: middle; } | |
.compass .w { left: 0px; } | |
.compass .n.w, .compass .s.w { left: 2em; } | |
.compass .n, .compass .s { left: 6em; } | |
.compass .n.e, .compass .s.e { left: 10em; } | |
.compass .e { left: 12em; } | |
.compass .n { top: 0px; } | |
.compass .n.w, .compass .n.e { top: 2em; } | |
.compass .w, .compass .e { top: 6em; } |
module Anonymizer | |
def anonymize_attribute(attribute) | |
self.send(:include, Module.new do | |
define_method attribute do | |
a = @attributes[attribute.to_s] | |
a && attribute.to_s.ends_with?("_id") ? a.to_i : a | |
end | |
define_method "#{attribute}_with_anonymous" do | |
send("#{attribute}_without_anonymous") unless anonymous? | |
end |
module ContentForHelpers | |
def content_for?(name, options = {}, &block) | |
has_content = (!instance_variable_get("@content_for_#{name}").strip.blank? rescue nil) | |
should_process = options[:negate] ? !has_content : has_content | |
if should_process && block_given? | |
concat(capture(&block), block.binding) | |
end | |
return should_process | |
end | |