Skip to content

Instantly share code, notes, and snippets.

🦄
⚡️🗽✌️

Brian Sipple BrianSipple

🦄
⚡️🗽✌️
Block or report user

Report or block BrianSipple

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 bounded-random.cpp
#include <cstdlib>
int boundedRandom(int min, int max) {
static const double randFraction = 1.0 / (static_cast<double>(RAND_MAX));
int offset = (max - min + 1) * (rand() * randFraction);
return min + offset;
}
View .gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
View _color.css
:root {
/* --------------- THEME COLORS --------------- */
--theme-color__primary: #9D6D45;
--theme-color__primary--light: #AA764B;
--theme-color__primary--dark: #1D140D;
--theme-color__supporting-1: #56ee9d;
--theme-color__supporting-1--light: #99FBC7;
View bounded-random.js
const { floor, random } = Math;
function boundedRandom(min, max) {
const spread = max - min;
return min + floor(random() * spread);
}
@BrianSipple
BrianSipple / _breakpoints.css
Created Apr 14, 2017
CSS Breakpoint Variables
View _breakpoints.css
/**
* BREAKPOINTS THRESHOLDS
*/
:root {
--breakpoint-threshold--mobile: 22em; /* Roughly, a min-width for handsets */
--breakpoint-threshold--small: 30em; /* Roughly, a max-width for handsets in landscape */
--breakpoint-threshold--medium: 49.125em; /* Roughly, a min-width for tablets */
--breakpoint-threshold--large: 64em; /* Roughly, a max-width for tablets in landscape */
--breakpoint-threshold--xLarge: 90em; /* Someone probably has a monitor 💻 */
}
@BrianSipple
BrianSipple / range.js
Last active Mar 22, 2018
JavaScript "range" helper: Generates an iterable list of numbers from `start` to `end`, inclusive.
View range.js
export default function range(_start, _end) {
// If only one argument (n) is passed, we generate a range from 0 to n.
const start = typeof _end === 'undefined' ? 0 : _start;
const end = typeof _end === 'undefined' ? _start : _end;
// "direction" multiplier to produce a decreasing sequence if `start` is greater than `end`.
const direction = start > end ? -1 : 1;
const size = Math.abs(end - start) + 1;
@BrianSipple
BrianSipple / spacing-utilities.css
Last active May 23, 2017
CSS Spacing Utilities
View spacing-utilities.css
@import "../variables/_spacing.css";
/*
* SPACING UTILITIES
*
* Utilities for setting padding and margin.
*
* Legend:
*
* Rules:
@BrianSipple
BrianSipple / controllers.application.js
Last active Dec 27, 2016
ember-2.10-dynamic-use-xlink:href-attribute
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View keybase.md

Keybase proof

I hereby claim:

  • I am briansipple on github.
  • I am briansipple (https://keybase.io/briansipple) on keybase.
  • I have a public key ASChCbTKxIsPPl3PHfHTIKV4VPjtyHQZuq3qV1tXd92YNQo

To claim this, I am signing this object:

@BrianSipple
BrianSipple / components.my-img.js
Last active Apr 12, 2018
ember-2.9-dynamic-img-src-attribute
View components.my-img.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'img',
attributeBindings: ['imagePath:src', 'imageName:alt'],
imagePath: '',
imageName: ''
});
You can’t perform that action at this time.