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
ALTER SYSTEM SET extra_float_digits = 0; | |
ALTER SYSTEM SET max_wal_senders = 0; | |
ALTER SYSTEM SET wal_level = minimal; | |
ALTER SYSTEM SET effective_io_concurrency = 2; |
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
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | |
data:text/html,<body style="background-color:%237f8c8d;height:100%;margin:0"></body> |
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
# frozen_string_literal: true | |
source 'https://rubygems.org' | |
gem 'dht-sensor-ffi' | |
gem 'rainbow' |
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 TEMP TABLE beer(name text); | |
INSERT INTO beer VALUES ('Guinness'); | |
SELECT * FROM beer; | |
-- name | ctid | |
------------+------- | |
-- Guinness | (0,1) | |
-- (1 row) | |
UPDATE beer SET name = 'Guinness' WHERE name != 'Guinness'; |
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
// The Module object: Our interface to the outside world. We import | |
// and export values on it, and do the work to get that through | |
// closure compiler if necessary. There are various ways Module can be used: | |
// 1. Not defined. We create it here | |
// 2. A function parameter, function(Module) { ..generated code.. } | |
// 3. pre-run appended it, var Module = {}; ..generated code.. | |
// 4. External script tag defines var Module. | |
// We need to do an eval in order to handle the closure compiler | |
// case, where this code here is minified but Module was defined | |
// elsewhere (e.g. case 4 above). We also need to check if Module |
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
for p in .vim/pack/bundle/start/*; do echo "* [$(basename $p)]($(grep -oP https://.+/$(basename $p) .gitmodules))"; done |
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
SELECT format( | |
E'{"index": {"_index": "%s", "_type": "%s", "_id": %s}}\n%s', | |
current_database() || '_users', | |
'user', | |
t.id, | |
json_build_object('username', t.username, 'email', t.email)) | |
FROM users t; |
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
DELETE FROM tbl WHERE ctid = ANY(array(SELECT ctid FROM tbl LIMIT 10000)) RETURNING *; |
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
class Cart::Checkout < Operation::Base | |
call do | |
Order.create(...) | |
end | |
before do | |
cancel! if cart.empty? | |
end | |
around do |
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 OR REPLACE FUNCTION public.NOW() RETURNS timestamp AS 'SELECT timestamp ''2016-01-01''' LANGUAGE SQL IMMUTABLE; | |
SELECT NOW(); | |
BEGIN; | |
SET LOCAL search_path TO public,pg_catalog; | |
SELECT NOW(); | |
COMMIT; | |
SELECT NOW(); |
NewerOlder