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/env sh | |
if command -v apt-fast > /dev/null 2>&1 | |
then | |
sudo apt-fast update && sudo apt-fast upgrade -y | |
else | |
if command -v apt > /dev/null 2>&1 | |
then | |
sudo apt update && sudo apt upgrade -y | |
fi |
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
function fish_prompt --description 'Write out the prompt' | |
# Cache exit status | |
set -l last_status $status | |
# Just calculate these once, to save a few cycles when displaying the prompt | |
if not set -q __fish_user | |
if test (id -u) -eq 0 | |
set -g __fish_user '#' | |
else | |
set -g __fish_user '&' |
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 {inspect} from 'util'; | |
/** | |
* This show arguments and output of a function / a method | |
* | |
* @param {Function} thisArg | |
* @param {Function} func | |
*/ | |
export const spy = <T, A extends any[], R, F extends (this: T, ...args: A) => R>(thisArg: T, func: F): F => { | |
return function() { |
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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see https://i3wm.org/docs/userguide.html for a complete reference! |
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
({name: player.currentItem.label + '.mpga', source: player.currentItem.source}) |
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
-- Fetch enum values | |
SELECT e.enumlabel | |
FROM pg_type t | |
INNER JOIN pg_enum e ON t.oid = e.enumtypid | |
WHERE t.typname = :enumtypname | |
ORDER BY e.enumsortorder; | |
-- export enums |
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 cleanUtf8Regex = str => { | |
let i = 0; | |
let res = ''; | |
let code; | |
while(code = str.charCodeAt(i)) { | |
res += 0x7E < code && code <= 0xFF ? `\\x{${code.toString(16)}}` : str[i]; | |
i += 1; | |
} | |
return res; | |
} |
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 notString = s => `^(?:[^${s[0]}]|${s[0]}(?!${s.substring(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
<?php | |
if (!function_exists('interface_exists')) { | |
die('PHP version too old'); | |
} | |
$throwables = listThrowableClasses(); | |
$throwablesPerParent = splitInParents($throwables); | |
printTree($throwablesPerParent); | |
if (count($throwablesPerParent) !== 0) { | |
die('ERROR!!!'); |
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
[ | |
{ | |
"code": "AED", | |
"symbol": "د.إ", | |
"name": "UAE dirham" | |
}, | |
{ | |
"code": "AFN", | |
"symbol": "؋", | |
"name": "Afghan afghani" |
NewerOlder