Skip to content

Instantly share code, notes, and snippets.

Andrew Clark acdlite

View GitHub Profile
@acdlite
acdlite / _color.scss
Last active Dec 27, 2015
Experiment using Sass maps to handle project-level configuration.
View _color.scss
$brand-color: (
red: #cf383a,
blue: #1f98d4,
yellow: #e4cb14,
white-eggshell: #f2efe2,
white: #000000,
black: #ffffff
);
// Returns brand color
@acdlite
acdlite / SassMeister-input.scss
Created Nov 4, 2013
Experiment using Sass maps to organize Susy Next configuration. Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
$grid: (
small: 90% 8 1/4,
medium: 80% 8 1/4,
large: 80% 12 1/4,
);
@acdlite
acdlite / SassMeister-input.scss
Created Nov 4, 2013
More experimenting using maps to organize Susy grids (or any other kind of data). Essentially, this is just abstracting calls to map-set() and map-merge to make the syntax more friendly. Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
$_grids: ();
@mixin add-grid($g, $name) {
$_grids: map-merge($_grids, ($name: $g));
}
@acdlite
acdlite / gist:9168073
Last active Aug 29, 2015
Sass/Compass mixin for diagonal stripe pattern backgrounds
View gist:9168073
@mixin diagonal-stripe-pattern-background($color-1, $color-2, $ratio, $size) {
$ratio: percentage($ratio / 2);
@include background(linear-gradient(-45deg,
$color-1 (50% - $ratio),
$color-2 (50% - $ratio),
$color-2 50%, $color-1 50%,
$color-1 (100% - $ratio),
$color-2 (100% - $ratio)));
@include background-size($size $size);
}
@acdlite
acdlite / SassMeister-input.scss
Created Mar 10, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.3.3)
// Compass (v1.0.0.alpha.18)
// Sassy Maps (v0.3.2)
// ----
@import "sassy-maps";
$__namespaces: ();
@acdlite
acdlite / SassMeister-input.scss
Created Jul 18, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.3.10)
// Compass (v1.0.0.alpha.20)
// Base.Sass (v1.3.3)
// ----
@import "compass";
@import "base.sass/*";
@acdlite
acdlite / SassMeister-input.scss
Created Jul 18, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.3.10)
// Compass (v1.0.0.alpha.20)
// Base.Sass (v1.3.3)
// ----
@import "base.sass/*";
$anonymous-placeholders: ();
@acdlite
acdlite / convert-video-for-web.sh
Last active Aug 21, 2017
Convert videos for web
View convert-video-for-web.sh
#!/bin/bash
# Based on http://asisolve.com/ffmpeg-encoding-settings-for-web-video/
for f in src/*.mov
do
name=$(basename $f .mov)
# Convert to mp4
ffmpeg -i $f -vcodec libx264 -preset slow -profile main -crf 25 -acodec libfdk_aac -ab 64k dist/$name.mp4
View gist:d1c1b7bc95e5f869424d
class Store {
constructor(state = {}) {
this.state = state;
}
getState() {
return this.state;
}
}
@acdlite
acdlite / pureRenderMixin.js
Last active Jul 17, 2019
Pure Render Mixin in ES6
View pureRenderMixin.js
function pureRenderMixin(Component) {
Component.prototype.shouldComponentUpdate(nextProps, nextState) {
return !shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState);
}
return Component;
}
class MyComponent extends React.Component {}
You can’t perform that action at this time.