Skip to content

Instantly share code, notes, and snippets.

View yourpalsonja's full-sized avatar
🦒

Sonja Farrell yourpalsonja

🦒
View GitHub Profile
var boringArray = [1,2,3,4];
const rReduce = (arr, func, acc) => {
acc ? acc : arr[0];
if(arr.length === 0) {
return acc;
}
return rReduce(arr.slice(1), func, func(acc, arr[0]))
@yourpalsonja
yourpalsonja / reduce.js
Last active December 20, 2017 20:41
Recursive Reduce
var boringArray = [1,2,3,4];
var datesArray = [1878, 1980, 1535, 1879];
var reducer = (a, b) => a + b;
var earliestReducer = (a, b) => {
if(a < b) {
return a;
}
return b;
@yourpalsonja
yourpalsonja / .csscomb.json
Created November 17, 2016 02:05
CSS Comb Config
{
"exclude": [
".git/**",
"node_modules/**",
"bower_components/**"
],
"verbose": true,
"always-semicolon": true,
"block-indent": " ",
"colon-space": ["", " "],
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@yourpalsonja
yourpalsonja / gist:5681522
Last active December 17, 2015 22:19
SASS Retina Background Mixin
// retina background mixin with compass
@mixin pretty-image($image, $retina-image) {
background-image: url($image);
@media (-webkit-min-device-pixel-ratio: 1.5),
(min-resolution: 1.5dppx) {
background-image: url($retina-image);
background-size: image-width($image) image-height($image);
}
}
@yourpalsonja
yourpalsonja / switch.css
Created February 14, 2013 20:07
Non-janky, mostly semantic slider-switch. Works for mobile, too!
.slide-switch {
position: relative;
width: 5.5em;
display: inline-block;
vertical-align: middle;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select: none;
margin-left: 10px;
}
@yourpalsonja
yourpalsonja / slider-switch.css
Created February 1, 2013 00:56
Semantic slider switch
/* slider switch */
.switch {
display: block !important;
background: -moz-linear-gradient(left, #e0f0fa 0%, #e0f0fa 50%, #d3d7d7 50%, #d3d7d7 100%);
background: -webkit-linear-gradient(left, #e0f0fa 0%,#e0f0fa 50%,#d3d7d7 50%,#d3d7d7 100%);
background: -ms-linear-gradient(left, #e0f0fa 0%,#e0f0fa 50%,#d3d7d7 50%,#d3d7d7 100%);
background: linear-gradient(to right, #e0f0fa 0%,#e0f0fa 50%,#d3d7d7 50%,#d3d7d7 100%);
box-shadow: inset 0 1px @light-input-shadow;
cursor: pointer;
height: 3em;
@yourpalsonja
yourpalsonja / checkbox-css.css
Created January 31, 2013 23:11
Topcoat Checkbox Tests
/* Dual Label */
.dual-label {
width: 70px;
display: inline-block;
}
.checkbox-image {
display: inline-block;
width: 35px;
height: 31px;