Se hai cliccato lascia un TUO commento nel muro della vergogna
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
| CREATE TEMPORARY TABLE temporary_table AS SELECT * FROM <my_table> WHERE <condition>; | |
| -- Remove any columns that will cause a constraint error when re-inserting the row | |
| ALTER TABLE temporary_table DROP COLUMN id; | |
| -- Re-insert 100 copies of the row with a new UUID | |
| INSERT INTO <my_table> SELECT uuid_generate_v4() AS id, temporary_table.* FROM temporary_table CROSS JOIN GENERATE_SERIES(1,100); |
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
| const {isArray} = Array; | |
| const sync = async values => { | |
| for (let {length} = values, i = 0; i < length; i++) { | |
| const value = await values[i]; | |
| values[i] = isArray(value) ? await sync(value) : value; | |
| } | |
| return values; | |
| }; |
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
| # -*- coding: utf-8 -*- | |
| # memoize support for plone.subrequest subrequests. | |
| # usage: | |
| # >>> import ./memoize | |
| # >>> from ./memoize import instance_memoize | |
| # >>> @memoize.parent_request_memoize | |
| # >>> def _results(self): | |
| # >>> return "expensive calculation" | |
| # >>> |
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 CopyButton({ value }) { | |
| let [copied, setCopied] = React.useState(); | |
| let hydrated = usePageIsHydrated(); | |
| React.useEffect(() => { | |
| let id = setTimeout(() => setCopied(false), 2000); | |
| return () => clearTimeout(id); | |
| }, [copied]); | |
| return ( | |
| <button |
uce vs lit-element
A very simple comparison table between these two libraries.
| uce | lit-element | |
|---|---|---|
| version | 1.11.9 | 2.4.0 |
| license | ISC (simplified MIT) | BSD-3-Clause License |
| language | JS w/ TS definition | TS w/ JS transpilation |
| size ( brotli ) | 9437b ES5 / 6811b ES2015+ | 8634b ES5 / 6708b ES2015+ |
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
| let currentColor = '#ebedf0'; | |
| let clicking = false; | |
| const boxes = document.querySelectorAll('.js-calendar-graph-svg rect'); | |
| const graph = document.querySelector('.js-calendar-graph-svg'); | |
| // code for switching the current color | |
| function handleColorChange(e) { | |
| const el = e.currentTarget; | |
| currentColor = el.style['background-color']; | |
| console.log(currentColor) |
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
| """ | |
| LICENSE: MIT | |
| Example of using unix socket in SOCK_DGRAM mode. | |
| """ | |
| import socket | |
| import socketserver | |
| import time |
a gist to recap the current status, also available as library picker!
do one thing only and do it well
- µhtml (HTML/SVG auto-keyed and manual keyed render)
- augmentor (hooks for anything)
- wickedElements (custom elements without custom elements ... wait, what?)
NewerOlder