Skip to content

Instantly share code, notes, and snippets.

Robin Smidsrød robinsmidsrod

Block or report user

Report or block robinsmidsrod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View order_by.diff
1c1
< (CASE pc.parent_sort_key
---
> (CASE COALESCE(pc.parent_sort_key)
6c6
< (CASE pc.parent_sort_key
---
> (CASE COALESCE(pc.parent_sort_key)
11c11
< (CASE pc.parent_sort_key
View _compute_container_sort_key.sql
CREATE OR REPLACE FUNCTION public._compute_container_sort_key (
in_container_id uuid
)
RETURNS text AS
$body$
WITH container_default_sort_key AS (
SELECT * FROM (VALUES
('folder', 'index_asc'),
('album', 'index_asc'),
('blog', 'updated_desc')
View list_container_by_parent.sql
SELECT
c.container_id AS id
FROM container c
JOIN container_tree ct ON ct.child_container_id = c.container_id
WHERE ct.parent_container_id = 'dec521e1-432e-4304-8ba8-6cf59590d99b'
ORDER BY
CASE COALESCE( 'index_asc', _compute_container_sort_key('dec521e1-432e-4304-8ba8-6cf59590d99b') )
WHEN 'index_asc' THEN c.sort_number ASC NULLS LAST, collkey(c.title, 'nb_NO') ASC
WHEN 'index_desc' THEN c.sort_number DESC NULLS FIRST, collkey(c.title, 'nb_NO') DESC
WHEN 'size_asc' THEN c.sort_number ASC NULLS LAST, collkey(c.title, 'nb_NO') ASC -- same as index_asc
View _compute_container_sort_key.sql
WITH container_default_sort_key AS (
SELECT * FROM (VALUES
('folder', 'index_asc'),
('album', 'index_asc'),
('blog', 'updated_desc')
) AS kv (container_type, default_sort_key)
)
SELECT COALESCE(NULLIF(NULLIF(c.sort_key, ''), 'default'), cdsk.default_sort_key) AS container_sort_key
FROM container c JOIN container_default_sort_key cdsk USING(container_type)
WHERE c.container_id = '6b6c8837-f3e5-4e63-a42b-5c07fd4b56ad';
View disable_vmbus_time_sync.sls
disable_vmbus_time_sync_on_startup:
file.line:
- name: /etc/rc.local
- match: "/usr/local/sbin/vmbus_time_sync disable"
- content: "/usr/local/sbin/vmbus_time_sync disable"
- mode: ensure
- before: "exit 0\n"
View user_has_permission_on.sql
SELECT (
-- Check access for objects
'container' = 'object' AND ( -- in_type
SELECT EXISTS (
-- Owner has all rights
SELECT 1
FROM object o
WHERE o.object_id = '82195a7e-86a2-4235-bcd6-126492273e64' -- in_element_id
AND o.owner_id = '86d09109-64cc-4aa6-9336-b49b8ae71f2c' -- in_account_id
) OR EXISTS (
View play_next_audio.js
<html>
<body id="#wrapper_object_content">
<h1>test</h1>
<div><a class="audio_mpeg" href="link1">link1</a></div>
<a class="audio_mpeg" href="link2">link2</a>
<p><a class="audio_mpeg" href="link3">link3</a></p>
</body>
</html>
$(document).ready( function() {
View gist:0f0983b1f34a4e20e5ca6db50a38056e
open my $minified_js, '-|', "minify_js.sh", $js_file or die("minify_js.sh failed: $!")
View gist:fd86b4d723aef2b37634f15867dbe85f
console.h:/* Everything but DEBUG and LOG output to BIOS console */
console.h:#undef CONSOLE_PCBIOS
console.h://#define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_DEBUG & ~CONSOLE_USAGE_LOG )
console.h:#define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG )
console.h:#define CONSOLE_VESAFB
console.h:/* Everything but TUI output to syslog console */
console.h:#undef CONSOLE_SYSLOG
console.h:#define CONSOLE_SYSLOG ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_TUI )
console.h:#undef LOG_LEVEL
console.h:#define LOG_LEVEL LOG_ALL /* Full syslog logging */
View autostart.sh
# To work around bugs reported by these systemd services
# systemctl status tmp-cores.mount
# systemctl status tmp-database.mount
# systemctl status tmp-joypads.mount
# systemctl status tmp-assets.mount
mkdir -p /tmp/cores
cp -a /usr/lib/libretro/* /tmp/cores/
cp -a /storage/cores/* /tmp/cores/
You can’t perform that action at this time.