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
<?php declare(strict_types=1); | |
$sections = json_decode( | |
<<<'JSON' | |
[ | |
{ | |
"title": "Getting started", | |
"reset_lesson_position": false, | |
"lessons": [ | |
{"name": "Welcome"}, |
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
CREATE FUNCTION array_reverse(anyarray) RETURNS anyarray RETURNS NULL ON NULL INPUT AS | |
$BODY$ | |
SELECT array_agg(result.value ORDER BY ordinality DESC) FROM unnest($1) WITH ORDINALITY AS result(value); | |
$BODY$ | |
LANGUAGE sql IMMUTABLE; |
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
[ | |
"https://cas.csfd.cz/mojeid-login/", | |
"https://cas.csfd.cz/mojeid-login/redirect/" | |
] |
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
CREATE FUNCTION check_enum_value(in_enum text, in_value text, in_name text = NULL) RETURNS void AS $BODY$ | |
DECLARE | |
items text[]; | |
BEGIN | |
EXECUTE(format('SELECT enum_range(null::%I)::text', in_enum)) INTO items; | |
IF (NOT(items @> ARRAY[in_value])) THEN | |
RAISE EXCEPTION USING MESSAGE = format( | |
$$'%s' must be one of: %s - '%s' was given$$, | |
CASE WHEN in_name IS NOT NULL THEN in_name ELSE in_enum END, | |
array_to_string( |
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
<?php | |
$iterations = 4000000; | |
$a = 'A'; | |
$b = 'B'; | |
$c = 'C'; | |
$d = 'D'; | |
$e = 10; | |
$f = 30; |
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
FROM php:7.2-rc-zts-alpine | |
ARG APP_USER_USERNAME=app | |
RUN apk update && apk add --no-cache \ | |
sudo bash \ | |
g++ make autoconf \ | |
libxml2-dev icu-dev curl-dev pcre-dev | |
RUN adduser -D -s /bin/bash $APP_USER_USERNAME \ |
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
INSERT INTO colors (name, hex) VALUES | |
('AliceBlue', '#F0F8FF'), | |
('AntiqueWhite', '#FAEBD7'), | |
('Aqua', '#00FFFF'), | |
('Aquamarine', '#7FFFD4'), | |
('Azure', '#F0FFFF'), | |
('Beige', '#F5F5DC'), | |
('Bisque', '#FFE4C4'), | |
('Black', '#000000'), | |
('BlanchedAlmond', '#FFEBCD'), |
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
CREATE FUNCTION restart_sequences() RETURNS VOID AS $$ | |
DECLARE | |
public_schema CONSTANT INTEGER NOT NULL DEFAULT 2200; | |
statements CURSOR FOR SELECT 'ALTER SEQUENCE ' || relname || ' RESTART;' AS query | |
FROM pg_class | |
WHERE relkind = 'S' | |
AND relnamespace = public_schema; | |
BEGIN | |
FOR stmt IN statements LOOP | |
EXECUTE stmt.query; |
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
SELECT string_agg(format('DROP DATABASE %I;', datname), '') FROM pg_database WHERE datistemplate = false AND datname LIKE 'test_%'; |
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
focus(); | |
addEventListener('blur', function() { | |
if(document.activeElement === document.getElementById('rolex-corner-v3')) { | |
alert("I have clicked on iframe"); | |
} | |
}); |
NewerOlder