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 OR REPLACE FUNCTION array_pop(a anyarray, element character varying) | |
RETURNS anyarray | |
LANGUAGE plpgsql | |
AS $function$ | |
DECLARE | |
result a%TYPE; | |
BEGIN | |
SELECT ARRAY( | |
SELECT b.e FROM (SELECT unnest(a)) AS b(e) WHERE b.e <> element) INTO result; | |
RETURN result; |
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
// Restify Server CheatSheet. | |
// More about the API: http://mcavage.me/node-restify/#server-api | |
// Install restify with npm install restify | |
// 1.1. Creating a Server. | |
// http://mcavage.me/node-restify/#Creating-a-Server | |
var restify = require('restify'); |
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 | |
/** | |
* This an IDE helper for developing games on Board Game Arena Studio. | |
* Feel free to use it in your preferred IDE to get out these ugly undefined methods errors and to have a direct | |
* documentation to classes / methods. | |
* | |
* @author Teddy Gandon | |
* @see https://gist.github.com/TeddyGandon/9e3183475252203b1ede192688b463cd | |
*/ |
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
dockershell() { | |
if [ "$1" = "service" ]; then | |
ID=$(docker inspect --format '{{.Status.ContainerStatus.ContainerID}}' $(docker service ps -q "$2" | head -1)) | |
else | |
ID=$2 | |
fi; | |
docker exec -t -i -e PS1="$ID:\w# " "$ID" bash --noprofile --norc | |
} |
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
# Razer Pro Type Ultra Keyboard | |
# Hardware Database file that switches the media keys and F1-F10 | |
# (F11 and F12 keypress events are not propagated through USB without the FN key) | |
# | |
# Instructions: | |
# save the content of this file to "/etc/udev/hwdb.d/50-razer-pro-type-ultra.hwdb" | |
# apply (persistent) changes using "sudo systemd-hwdb update && sudo udevadm trigger" | |
evdev:input:b*v1532p027B* | |
KEYBOARD_KEY_c00e2=f1 | |
KEYBOARD_KEY_c00ea=f2 |