Skip to content

Instantly share code, notes, and snippets.

View morewry's full-sized avatar
💭
⛈ 🌩 ☁️ 🌧 ☁️ ⛈ 🌧 🌩 ☁️

Rhy Moore morewry

💭
⛈ 🌩 ☁️ 🌧 ☁️ ⛈ 🌧 🌩 ☁️
View GitHub Profile
@morewry
morewry / config.rb
Last active October 1, 2015 21:07
"Ad Hoc" Compass plugins config.rb, potentially useful for dealing with compass plugins through bower instead of as gems. Set up a plugin similarly to https://github.com/Team-Sass/Compass-Extension-Template
# make ad hoc compass frameworks behave (show up in list, be import-able like normal)
# custom vars
thisplugin_dir = (yours)
# compass config
extensions_dir = (yours)
extensions_path = project_path + extensions_dir
additional_import_paths = [extensions_dir, extensions_dir + thisplugin_dir + 'stylesheets']
@morewry
morewry / _include-or-extend-defaults.scss
Last active October 1, 2015 21:07
Sass @include or @extend with generated selectors & override-able rules
// ---------------------------------------
/*
http://codepen.io/morewry/pen/meBtj
Use case for defaults:
providing interface points to override framework defaults with more flexibility and granularity than variables can reasonably provide, ie customize normalizations without editing the stylesheet directly (@content in reverse)
Use case for swapping extend or include:
@morewry
morewry / _sprite.scss
Last active August 29, 2015 13:57
Compass sprites with placeholder (use compass icon sprites with placeholders) instead of class selectors (except the generated sprite map) and retina support
/*
# Sprite (Theme)
*/
// ---------------------------------------
// Config
$disable-magic-sprite-selectors: true;
$sprite-default-margin: 1px;
$sprite-debug: true;
@zsup
zsup / ddd.md
Last active April 2, 2025 23:33
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
@othersmallcities
othersmallcities / _icons.scss
Last active August 29, 2015 13:55 — forked from morewry/_icons.scss
compass retina sprite with placeholder
$disable-magic-sprite-selectors: true;
$icons-inline: false;
$icons-sprite-base-class: "%icons-sprite";
$icons-layout: vertical; //must in order to get the correct position! -> this appears to be a bug in Compass 0.12.2; @include background-size gives the correct posititon, $var-sprite-position($img) does not.
$icons: sprite-map("folder-name/*.png");
@import "folder-name/*.png";
@each $img in sprite-names($icons) {
%icon-#{$img} {
@extend %icons-sprite;
@pamelafox
pamelafox / gist:6718591
Last active December 24, 2015 00:40
A surprising use of JS
// Pop quiz!
// 1. What will x and y be in this code?
(function() {
var x = 5;
var y = 10;
var coordinates = x, y;
console.log('First');
console.log(x);
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@jackie
jackie / breakpoints.json
Last active December 19, 2015 15:28
Sass Script function to get breakpoint values from a JSON file.
{
"phone" : "all and (max-width: 603px)",
"desktop": "all and (min-width: 1025px)",
"tablet" : "all and (min-width: 604px) and (max-width: 1024px)"
}
@morewry
morewry / Search-Nested-Backbone-LayoutManager-Views.js
Last active December 19, 2015 03:59
Backbone & Backbone Layout Manager - search for a nested view, recursive getView
// Pass in a starting view and match comparison
function findView ( startView, searchFn ) {
var resultView,
viewSearch = function ( curView ) {
curView.getView( function ( nestedView ) {
if ( searchFn( nestedView ) ) {
resultView = nestedView;
}
else {
viewSearch( nestedView );
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2025 08:16
A badass list of frontend development resources I collected over time.