- StyleLint BEM
- CSS BEM
- CSS Modules (babel-react-css-modules-plugin)
- z-index stacking mixin
- Mixins over Global definition of styles?
- Scut
- Parent positions children
- Bring semantics into css but keep them in html
- Styletron :/
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
function detectSeparator(input) { | |
const availableSeparators = [ ';', ',', '|' ]; | |
const separatorCount = availableSeparators.map((separator) => occurrences(input, separator)); | |
return R.transpose([ availableSeparators, separatorCount ]) | |
.reduce((maxSeparator, separator) => { | |
return separator[1] > maxSeparator[1] ? separator : maxSeparator; | |
}, [ availableSeparators[0], -1 ])[0]; | |
} |
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
function isMultipleOf(x, say) { | |
return (i) => i % x == 0 ? say() : ''; | |
} | |
const thenSay = (say) => () => say; | |
// The order matters. Any function with the signature (any)->(int)->str is valid | |
const whatShouldISayWhen = [ | |
isMultipleOf(3, thenSay('Fizz')), | |
isMultipleOf(5, thenSay('Buzz')) | |
]; |
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 fs = require('fs'); | |
const requirePatterns = [ | |
/(import.*from\W*)(?:(')(.*)(?!\/)'|(")(.*)(?!\/)")(.*)/g, | |
/(require\W*\()(?:(')(.*)(?!\/)'|(")(.*)(?!\/)")(.*)/g | |
]; | |
const extension = '.ts'; | |
function decodeOption(key, value) { | |
switch (key) { |
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
klas = item_type.constantize | |
has_many_associations = klas.reflections.collect { |_, c| c.class_name if c.macro == :has_many }.compact | |
has_one_associations = klas.reflections.collect { |_, c| c.class_name if c.macro == :has_one }.compact | |
instance = klas.find item_id | |
@result = instance.some_method | |
has_one_associations.each do |assoc_string| | |
assoc_string = assoc_string.underscore |
NewerOlder