This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
interface DonutProps { | |
segments: { | |
color: string; | |
percentage: number; | |
}[]; | |
thickness?: number; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /config/api/public/singletons.php | |
# GET /api/public/singletons | |
# GET /api/public/singletons?lang=de | |
<?php | |
$options = []; | |
$response = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// transforms a rejection into a custom-format. | |
const catchTransformer = (fn, catchMap) => fn().catch(err => Promise.reject(catchMap(err))); | |
// Example of code that we don't control. The rejection follows its own format (e.g. fetch api). | |
const doSomethingAsyncThatFails = () => | |
new Promise((resolve, reject) => { | |
setTimeout(() => reject(new Error('failed')), 1000); | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const transformArrayToDictionary = (items, idKey) => items.reduce((acc, item) => { | |
const { [idKey]: title, ...rest } = item; | |
return { | |
...acc, | |
[title]: rest | |
} | |
}, {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const removeKeyFromObject = (obj, key) => { | |
const { [key]: _, ...rest } = obj; | |
return rest; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const FIELD_TYPE_BLACKLIST = ['file', 'reset', 'submit', 'button']; | |
const isFieldSerializable = (field) => field.name && FIELD_TYPE_BLACKLIST.indexOf(field.type) === -1 | |
const formFieldsReducer = (state, field) => { | |
if (!isFieldSerializable(field)) { | |
return state; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove falsey elements from array | |
const compact = (arr) => arr.filter(Boolean) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
@function imagePath($imageName) { | |
@return 'siroop.ch/#{$imageName}'; | |
} | |
.foo { | |
background-image: url(imagePath('header.png')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.3) | |
// ---- | |
@mixin outer { | |
@content; | |
} | |
@mixin inner { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.3) | |
// ---- | |
@mixin outer { | |
@content; | |
} | |
@mixin inner { |
NewerOlder