View multiFilters.js
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 data = [ | |
{ location: { title: 'b' }, size: 25, price: 830 }, | |
{ location: { title: 'c' }, size: 28, price: 700 }, | |
{ location: { title: 'other' }, size: 21, price: 500 } | |
]; | |
function main() { | |
const locationFilter = ['b', 'c']; | |
const priceFilter = []; |
View media-queries.sass
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
// ****************************************/ | |
// Media Queries | |
// ****************************************/ | |
| |
// Media breakpoints | |
$mq-desktop-xl: 1680px | |
$mq-desktop: 1382px | |
$mq-desktop-small: 1280px | |
$mq-tablet-landscape: 1024px | |
$mq-tablet-portrait: 768px |
View A.jsx
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
// A component with accessors | |
// The accessors can only be accessed inside the actual component | |
function C(props) { | |
// ... | |
} | |
C.bar = () => { | |
// this method can be accessed within the component | |
} |
View .jsx
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
// ****************************************/ | |
// Media Queries | |
// ****************************************/ | |
// ----------------------------------------- | |
import { css } from 'styled-components'; | |
// Media breakpoints | |
const desktopXL = 1680; | |
const desktop = 1280; |
View .js
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 Foo = styled.div` | |
display: block; | |
opacity: 0; | |
color: ${by('color')}; | |
${eq('red')` | |
background-color: red; | |
`}; | |
${isEqOr('left', 'right')` |
View .js
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 $T = text => document.createTextNode(text) | |
function $E(tag, props, kids) { | |
const elem = document.createElement(tag) | |
for (const k in props) { | |
elem[k] = props[k] | |
} | |
for (const kid of kids) { | |
elem.appendChild(kid) | |
} |
View chars.cc
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
#include <iostream> | |
#include <locale> | |
#include <string> | |
#include <fstream> | |
#include <codecvt> | |
// utf8/utf16/utf32 can be directly written to file without conversions | |
// sizeof(T) gives you bytes of the type | |
// .size() .length() gives count of chars | |
// if char16_t is stored the open the file with utf16 encoding |
View compute.cpp
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
#include <iostream> | |
#define NS_PRIVATE_IMPLEMENTATION | |
#define CA_PRIVATE_IMPLEMENTATION | |
#define MTL_PRIVATE_IMPLEMENTATION | |
#include "Metal.hpp" | |
MTL::Buffer* outputs; | |
MTL::Buffer* input0; |