SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
AND C.relkind <> 'i'
AND nspname !~ '^pg_toast'
ORDER BY pg_total_relation_size(C.oid) DESC
LIMIT 25;
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://ramdajs.com/repl/#?%2F%2F%20https%3A%2F%2Fphilipnilsson.github.io%2FBadness10k%2Ffunctional-waterflow%2F%0A%0Aconst%20input%20%3D%20%5B2%2C%205%2C%201%2C%202%2C%203%2C%204%2C%207%2C%207%2C%206%5D%0A%2F%2F%20const%20input%20%3D%20%5B2%2C%201%2C%203%2C%204%2C%201%2C%202%2C%201%2C%203%2C%202%2C%201%2C%200%2C%202%2C%204%2C%203%2C%201%2C%205%2C%203%2C%201%2C%204%2C%201%2C%202%2C%201%2C%200%2C%205%2C%202%2C%201%2C%203%5D%0A%0A%0A%2F%2F%20When%20is%20a%20one%20block%20%60b%60%20of%20%60height%28b%29%60%20filled%20with%20water%3F%0A%0A%2F%2F%20there%20is%20some%20bL%20%28on%20the%20left%29%20that%20has%20height%28bL%29%20%3E%20height%28b%29%0A%2F%2F%20and%20there%20is%20some%20bH%20on%20the%20right%20that%20has%20height%28bH%29%20%3E%20height%28b%29%0A%0Aconst%20mapIndexed%20%3D%20addIndex%28map%29%0A%0A%2F%2F%20For%20each%20index%20in%20the%20input%2C%20compute%20highest%20wall%20from%20the%20left%20side%0Aconst%20leftWalls%20%3D%20source%20%3D%3E%20map%28%0A%20%20i%20%3D%3E%20pipe%28%0A%20%20%20%20take%2 |
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
(ns clojure.examples.hello | |
(:gen-class)) | |
;; how to execute a function? (fn argument1 argument2 ...) | |
;; this is how a function is defined | |
(defn isMod0 [i n] | |
(= 0 (mod i n))) | |
(defn fizzBuzz |
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
db.getCollection('collection-name') | |
.find() | |
.sort( {"price":1} ) | |
.skip(db.getCollection('collection-name').count() / 2 - 1) | |
.limit(1); |
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
const readline = require('readline'); | |
readline.emitKeypressEvents(process.stdin); | |
process.stdin.setRawMode(true); | |
process.stdin.on('keypress', (str, key) => { | |
console.log(str) | |
console.log(key) | |
}) |
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
import { useEffect, useState } from 'react'; | |
export const SCROLL_UP = 'up'; | |
export const SCROLL_DOWN = 'down'; | |
export const useScrollDirection = (initialDirection = SCROLL_DOWN, thresholdPixels = 64) => { | |
const [scrollDir, setScrollDir] = useState(initialDirection); | |
useEffect( | |
() => { |
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"id": 1, | |
"zipcode": 36235, | |
"city": "Abertamy", | |
"district": "Karlovy Vary", | |
"selfGoverningRegion": "Karlovarský", | |
"region": "Jihočeský a Západočeský", | |
"country": "CZ" | |
}, |
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
module Main exposing (..) | |
import Html exposing (..) | |
import Html.App as App | |
import Html.Events exposing (onClick) | |
import Req exposing (..) | |
main : Program Never | |
main = |