This has been moved to a regular Github repo:
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
/* | |
Basic Usage | |
=========== | |
Assuming your markup looks like this: | |
<table id="table" class="table"></table> | |
<div id="pagination" class="text-center"></div> |
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 public.json_append(data json, insert_data json) | |
RETURNS json | |
IMMUTABLE | |
LANGUAGE sql | |
AS $$ | |
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json | |
FROM ( | |
SELECT * FROM json_each(data) | |
UNION ALL | |
SELECT * FROM json_each(insert_data) |
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
cons = ->(x,y){ ->(a){ a.(x,y) } } | |
car = ->(c){ c.(->(x,_){ x }) } | |
cdr = ->(c){ c.(->(_,y){ y }) } | |
pair = cons.(1,2) | |
puts car.(pair) | |
puts cdr.(pair) |
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
#!/usr/bin/ruby -w | |
if ENV['DEBUG'] | |
def debug(message) | |
$stderr.puts message | |
end | |
else | |
def debug(message) | |
# nop | |
end |
NewerOlder