This file contains hidden or 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
| # official docs: https://graphql-ruby.org/dataloader/sources.html | |
| # app/graphql/sources/association.rb | |
| class Sources::Association < ::GraphQL::Dataloader::Source | |
| def initialize(association_name, scope = nil) | |
| @association_name = association_name | |
| @scope = scope | |
| end | |
| def fetch(records) |
This file contains hidden or 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
| @mixin font($font-size: 15px, $leading: 120%, $letter-spacing: 0) { | |
| @function removeUnit($val) { | |
| @return $val / ($val * 0 + 1) | |
| } | |
| $font-size-no-unit: removeUnit($font-size); | |
| $leading-no-unit: removeUnit($leading); | |
| $letter-spacing-no-unit: removeUnit($letter-spacing); | |
| $font-size-rem: ($font-size-no-unit) / 10; | |
| $leading-rem: ($leading-no-unit) / 10; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 React from 'react' | |
| import { render } from 'react-dom' | |
| import App from './components/App' | |
| renderReact('#root', App) | |
| function renderReact(htmlSelector, Component) { | |
| Array.from(document.querySelectorAll(htmlSelector)) | |
| .forEach(component => render(<Component {...component.dataset} />, component)) | |
| } |
This file contains hidden or 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 function serialize(form, type = 'string') { | |
| const elements = form.elements; | |
| let data = new Map(); | |
| [...elements].forEach(element => { | |
| if (!element.value.length) return; | |
| data.set(element.name, element.value); | |
| }); |
This file contains hidden or 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
| $data = ['dog', 'cat', 'rabbit', 'bird']; | |
| $max_per_row = 2; | |
| foreach (array_chunk($data, $max_per_row) as $rows) { | |
| echo '<div class="row">'; | |
| foreach ($rows as $column) | |
| echo '<div class="column">', $column, '</div>'; | |
| echo '</div>'; |
This file contains hidden or 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
| var locations = [ | |
| new google.maps.LatLng(43.5944677, -83.8888647), | |
| new google.maps.LatLng(43.1775256, -83.73412739999998), | |
| new google.maps.LatLng(43.4194699, -83.95080680000001), | |
| new google.maps.LatLng(43.0125274, -83.68745619999999), | |
| new google.maps.LatLng(42.732535, -84.55553470000001) | |
| ]; | |
| // fit the points in a bounds and zoom. | |
| fitBounds(locations); |
This file contains hidden or 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
| <script> | |
| CKEDITOR.stylesSet.add('CustomStyle', [ | |
| { | |
| name: 'Page Title', | |
| element: 'h1', | |
| styles: { | |
| 'color': '#222' | |
| } | |
| } | |
| ]); |
This file contains hidden or 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
| .background(@background: @blue) { | |
| .gradient > .linear(@background, @background); | |
| background-size: 1px 34px; | |
| } | |
| .text-shadow(@color: @blue) { | |
| text-shadow: 0 1px 0 darken(@color, 15%); | |
| } | |
| .hover() { |
NewerOlder