select max_conn,used,res_for_super,max_conn-used-res_for_super res_for_normal
from
(select count(*) used from pg_stat_activity) t1,
(select setting::int res_for_super from pg_settings where name=$$superuser_reserved_connections$$) t2,
(select setting::int max_conn from pg_settings where name=$$max_connections$$) t3;
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
#!/usr/bin/env bash | |
snap list --all | awk '/disabled/{system("sudo snap remove " $1 " --revision=" $3)}' |
- Author: Donny Kurnia
- Release Date: Jun 5, 2018
- Original Post
Take note this is my personal edited version and the command related to Arch has been changed to work on my Arch system.
This file has been truncated, but you can view the full file.
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
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
'use strict' | |
export function deepEqual (object1, object2) { | |
// check for falsy values | |
if (!object1 && !object2) return true | |
if (!object1 && object2) return false | |
if (object1 && !object2) return false | |
const keys1 = Object.keys(object1) | |
const keys2 = Object.keys(object2) |
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
'use strict' | |
function deepClone (data, hash = new WeakMap()) { | |
if (Object(data) !== data) return data | |
if (hash.has(data)) return hash.get(data) | |
const result = data instanceof Date | |
? new Date(data) | |
: (data instanceof RegExp | |
? new RegExp(data.source, data.flags) |
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
'use strict' | |
// converts camelCase to snake_case | |
// used to convert to database | |
// myVar => my_var | |
function toSnakeCase (objectArrayOrString) { | |
return keysToSnake(objectArrayOrString) | |
} | |
const toSnake = (s) => { |
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
'use strict' | |
// converts snake_case to camelCase | |
// used to convert from database | |
// my_var => myVar | |
function toCamelCase (objectArrayOrString) { | |
return keysToCamel(objectArrayOrString) | |
} | |
const toCamel = (s) => { |
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
SlideTransition.vue | |
```js | |
<template> | |
<div ref="container" style="transition: height 0.4s; overflow: hidden;"> | |
<div ref="content"> | |
<slot></slot> | |
</div> | |
</div> | |
</template> |
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
function buildFormData (formData, data, parentKey) { | |
if (data && typeof data === 'object' && !(data instanceof Date) && !(data instanceof File)) { | |
Object.keys(data).forEach(key => { | |
buildFormData(formData, data[key], parentKey ? `${parentKey}[${key}]` : key) | |
}) | |
} | |
else { | |
const value = data == null ? '' : data | |
formData.append(parentKey, value) |
NewerOlder