Skip to content

Instantly share code, notes, and snippets.

Doug Avery averyvery

Block or report user

Report or block averyvery

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dimension.scss
/*
example:
dimension(foo, bar, 2, 10px);
- gets the value bar inside foo map
- multiplies it by two
- adds 10px
*/
$dimensions: (
global: (
View nestedDescribe.js
// better describe() method that nests your describe blocks
// if you pass it a string with slashes
(function() {
var recursiveNestedDescribe = function(title, callback) {
var titleChunk = title.shift();
if (title.length === 0) {
describe(titleChunk, callback);
} else {
describe('/' + titleChunk, function() {
View build.js
require('colors');
import webpack from 'webpack';
import prettysize from 'prettysize';
import fs from 'fs';
import { execSync } from 'child_process';
import Table from 'cli-table';
import config from '../config/build.js';
webpack(config).run((error, stats) => {
if (error) console.log(error.red);
View engineering-standup.rb
#!/usr/bin/env ruby
# coding: utf-8
require 'pbcopy'
project_data = File.read('projects.csv')
hours_data = File.read('hours.csv')
projects = project_data.split(/\n/)
projects.shift
View screen.js
import store from 'data/store'
import browser from 'browser'
import Intro from './Intro'
import LevelEnd from './LevelEnd'
import Questions from './Questions'
import TimeoutTransitionGroup from 'vendor/timeout-transition-group'
export default React.createClass({
_getScreen() {
const level = store.getLevel(this.props.level)
View svg.jsx
// option for inlining (for index)
// option for caching (for SVGs used more than once)
export default React.createClass({
getInitialState() {
return {
svg: ''
}
},
View Main.js
module.exports = React.createClass({
getInitialState() {
return {
usingMouse : false,
focusedOnElement : false
}
},
_setUsingMouse(usingMouse) {
this.setState({usingMouse: usingMouse})
View sig.txt
▓█████▄ ▒█████ █ ██ ▄████ ▄▄▄ ██▒ █▓▓█████ ██▀███ ▓██ ██▓
▒██▀ ██▌▒██▒ ██▒ ██ ▓██▒ ██▒ ▀█▒ ▒████▄ ▓██░ █▒▓█ ▀ ▓██ ▒ ██▒▒██ ██▒
░██ █▌▒██░ ██▒▓██ ▒██░▒██░▄▄▄░ ▒██ ▀█▄▓██ █▒░▒███ ▓██ ░▄█ ▒ ▒██ ██░
░▓█▄ ▌▒██ ██░▓▓█ ░██░░▓█ ██▓ ░██▄▄▄▄██▒██ █░░▒▓█ ▄ ▒██▀▀█▄ ░ ▐██▓░
░▒████▓ ░ ████▓▒░▒▒█████▓ ░▒▓███▀▒ ▓█ ▓██▒▒▀█░ ░▒████▒░██▓ ▒██▒ ░ ██▒▓░
▒▒▓ ▒ ░ ▒░▒░▒░ ░▒▓▒ ▒ ▒ ░▒ ▒ ▒▒ ▓▒█░░ ▐░ ░░ ▒░ ░░ ▒▓ ░▒▓░ ██▒▒▒
░ ▒ ▒ ░ ▒ ▒░ ░░▒░ ░ ░ ░ ░ ▒ ▒▒ ░░ ░░ ░ ░ ░ ░▒ ░ ▒░▓██ ░▒░
░ ░ ░ ░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ░ ░ ▒ ░░ ░ ░░ ░ ▒ ▒ ░░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░ ░ ░
View spread.sass
// strip-units required by spread mixin
// http://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass
@function strip-units($number)
@return $number / ($number * 0 + 1)
// pow and sqrt required by ease function
// adapted from https://github.com/at-import/Sassy-math/blob/master/sass/math.scss
@function pow($base, $exponent)
$value: $base
@averyvery
averyvery / distribute.sass
Last active Aug 29, 2015
Smooth CSS property distribution with media queries
View distribute.sass
=distribute($property, $min, $max, $start, $end, $precision, $metric)
#{$property}: $min
// get the range we're operating on
$range: $end - $start
// get the number of iterations we need to run by seeing how precise we should be
$loops: strip-units(ceil($range / $precision)) - 1
You can’t perform that action at this time.