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 { useRef, useState, useEffect } from "react" | |
| import { type Props } from "payload/components/views/Cell" | |
| import { useConfig } from "payload/dist/admin/components/utilities/Config" | |
| const DEBOUNCE_UPDATE_MS = 1500 | |
| const EditableTextCell: React.FC<Props> = (props) => { | |
| const { field, collection, cellData, rowData } = props |
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 { Ref } from "vue" | |
| interface AsyncStateOptions<T, O> { | |
| transform?: (input: T) => O | |
| } | |
| interface AsyncStateReturnType<T> { | |
| execute: () => Promise<void>, | |
| refresh: () => Promise<void>, | |
| pending: Ref<boolean>, |
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
| # uncomment to force a specific HDMI mode (this will force VGA) | |
| hdmi_group=1 | |
| hdmi_mode=4 | |
| # uncomment to force a HDMI mode rather than DVI. This can make audio work in | |
| # DMT (computer monitor) modes | |
| hdmi_drive=2 | |
| #uncomment to overclock the arm. 700 MHz is the default. |
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
| img(src, width, height) | |
| image(src) | |
| background-size: contain | |
| background-repeat: no-repeat | |
| background-position: 50% | |
| max-width: width | |
| width: 100% | |
| margin-left: auto | |
| margin-right: auto |
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
| debounce = (timeout, fn, timer = null) -> -> | |
| clearTimeout timer | |
| timer = setTimeout fn, timeout |
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
| (function() { | |
| function loadScript(a,b){ | |
| var c=document.createElement('script'); | |
| c.type='text/javascript';c.src=a; | |
| var d=document.getElementsByTagName('head')[0],done=false; | |
| c.onload=c.onreadystatechange=function(){ | |
| if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){ | |
| done=true; | |
| b() | |
| } |
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
| psst = require 'psst' | |
| module.exports = require 'space-pen' | |
| module.exports.EventView = | |
| class EventView extends module.exports.View | |
| subscriptions: null | |
| initialize: -> | |
| return unless @subscriptions | |
| for subscription, method of @subscriptions |
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
| module.exports = (file, cb) -> | |
| valid = (/image\/(gif|jpg|jpeg|tiff|png)$/i).test file.type | |
| return false if not valid | |
| reader = new FileReader() | |
| reader.onload = (e) -> | |
| cb(e.target.result) | |
| reader.readAsDataURL(file) |
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 background = function(url) { | |
| - return "background-size: cover; background-image: url('" + url + "'); -ms-filter: \"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + url + "', sizingMethod='scale')\";"; | |
| - } |
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
| module.exports = | |
| class Pie | |
| pos: 0 | |
| colors: ['yellow', 'black'] | |
| constructor: (@canvas, {@yes, @no}) -> | |
| @data = [@yes, @no] | |
| @context = canvas.getContext("2d") | |
| #uses underscore for reduce but just swap with vanilla js if needed | |
| @total = _.reduce @data, (memo, num) -> memo + num | |
| @draw() |
NewerOlder