Skip to content

Instantly share code, notes, and snippets.

View brandonheyer's full-sized avatar

Brandon Heyer brandonheyer

View GitHub Profile
@brandonheyer
brandonheyer / rgbToHSL.php
Last active June 12, 2021 06:49
PHP snippet to convert RGB to HSL and HSL to RGB.
<?
function rgbToHsl( $r, $g, $b ) {
$oldR = $r;
$oldG = $g;
$oldB = $b;
$r /= 255;
$g /= 255;
$b /= 255;
@brandonheyer
brandonheyer / atom-style.scss
Created August 16, 2016 02:39
My Atom style example
atom-text-editor::shadow {
.gutter-container {
border-right: 1px dashed rgba(100, 120, 190, 0.2);
}
.gutter {
background-color: hsl(220, 13%, 17%);
}
[gutter-name=linter] {
@brandonheyer
brandonheyer / ff.js
Last active November 18, 2016 20:17
var _ = require('lodash');
var YOUR_PLAYER_ID = 8,
teams = {
0: 'Yates ',
1: 'Wuffalo ',
2: 'Cutler ',
3: 'RBs ',
4: 'FCL ',
5: 'Revv ',
@brandonheyer
brandonheyer / gist:f0e0607b90c26faad425a31de2e0ef55
Created March 23, 2018 14:15
componentWillReceiveProps debug
let isFalse = false;
const mappedOutput = map(nextProps, (v, k) => {
const diff = this.props[k] === v;
isFalse = isFalse || !diff;
return [k, v, diff];
});
if (isFalse) {
console.log(mappedOutput); //eslint-disable-line