A Pen by Ramnath Vaidyanathan on CodePen.
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, { useCallback } from "react"; | |
import { useField, withCondition } from "payload/components/forms"; | |
import { TextField } from "payload/dist/fields/config/types"; | |
import ColorInput from "../PayloadInput"; | |
import { text } from "payload/dist/fields/validations"; | |
export type Props = Omit<TextField, "type"> & { | |
path?: string; |
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 {Block} from 'payload/types'; | |
const createRecursiveLinksBlock = (current = 0, maxDepth = 3): Block => { | |
if (current < maxDepth - 1) { | |
current++; | |
return { | |
slug: `Level ${current}`, | |
fields: [ | |
{ | |
name: 'name', |
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 { getDocumentByID } from "./PayloadCommunicator.ts"; | |
import type { PageServerLoad } from './$types'; | |
export const load = (async ({ params }) => { | |
return await getDocumentByID('collection', params.id); | |
}) satisfies PageServerLoad; |
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 m = require("mithril"); | |
m.mount(document.querySelector("#menu"), { | |
view: function() { | |
return m("ul", [ | |
m("li", m('a[href="/a"]', {config: m.route}, "module A")), | |
m("li", m('a[href="/b"]', {config: m.route}, "module B")), | |
m("li", m('a[href="/c"]', {config: m.route}, "module C")) | |
]); | |
} |
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
#!/bin/bash | |
## Check for versions compiled with ARM at http://nodejs.org/dist/ | |
## Inspired by http://oskarhane.com/raspberry-pi-install-node-js-and-npm/ | |
## Fill in the Node Version here: | |
########################################################################## | |
NODE_VERSION="v8.2.1" |
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
#!/bin/bash | |
#enable job control in script | |
set -m | |
# when /etc/couchdb (contains i.g. admin account) was not allready moved to persistant storage, do it and symlink the org. directory | |
if [ ! -d /var/lib/couchdb/etc/couchdb ]; then | |
mkdir /var/lib/couchdb/etc | |
mv /etc/couchdb /var/lib/couchdb/etc/ | |
ln -s /var/lib/couchdb/etc/couchdb/ /etc/couchdb |
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
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: node-red | |
# Required-Start: $local_fs $remote_fs $network | |
# Required-Stop: $local_fs $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start or stop the node-red server | |
### END INIT INFO | |
# Can be downloaded and installed in one go by using this command |
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
const random = +new Date() | |
export default { | |
selector: function(sel) { | |
let match = /^\s*@keyframes (.*)$/i.exec(sel) | |
return match ? '@keyframes ' + match[1].trim() + random : sel | |
}, | |
value: function(val, key) { | |
return key=='animateName' ? val + random : val | |
} | |
} |
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 () { | |
// IndexedDB | |
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB, | |
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction, | |
dbVersion = 1.0; | |
// Create/open database | |
var request = indexedDB.open("elephantFiles", dbVersion), | |
db, | |
createObjectStore = function (dataBase) { |
NewerOlder