FROM postgres:14
RUN apt-get update && apt-get upgrade -y
ENV build_deps ca-certificates \
git \
build-essential \
libpq-dev \
postgresql-server-dev-14
RUN apt-get install -y --no-install-recommends $build_deps
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Map to values array, array spread vs array.from </title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>object lookup vs map lookup</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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
begin; | |
-- user accounts | |
create extension if not exists citext; | |
create table users ( | |
user_id int primary key generated always as identity, | |
username citext unique not null, | |
created_at timestamptz not null default now() | |
); |
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
-- {{{ libraries | |
local gears = require('gears') | |
local awful = require('awful') | |
awful.autofocus = require('awful.autofocus') | |
-- Widget and layout library | |
local wibox = require('wibox') | |
-- Theme handling library | |
local beautiful = require('beautiful') | |
-- Notification library | |
local naughty = require('naughty') |
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
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' | |
if not vim.loop.fs_stat(lazypath) then | |
vim.fn.system({ 'git', 'clone', '--filter=blob:none', 'https://github.com/folke/lazy.nvim.git', '--branch=stable', lazypath }) | |
end | |
vim.opt.rtp:prepend(lazypath) | |
vim.g.mapleader = ' ' -- 'vim.g' sets global variables | |
vim.g.loaded_netrwPlugin = 1 | |
require('lazy').setup({ |
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 bash | |
declare loud=0 | |
declare urgent | |
declare old_volume | |
declare old_volume | |
cleanup() { | |
set_volume "$old_volume" |
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 { useState, useEffect } from 'react' | |
export default function useJson(props) { | |
const [state, _setState] = useState({ | |
data: props.initData, | |
error: null, | |
loading: true, | |
}) | |
const setState = patch => s => _setState({ ...s, ...patch }) |
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 crypto = require('crypto') | |
module.exports = function hash({ method }, input) { | |
return new Promise((res, rej) => { | |
const h = crypto.createHash(method) | |
h.on('readable', () => { | |
const data = h.read() | |
if (data) { | |
res(data.toString('hex')) | |
} else rej() |
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 tput = require('./tput')() | |
tput.write('smcup') | |
tput.write('cup 0 0') | |
process.stdout.write('foo') | |
process.on('exit', () => { | |
tput.write('rmcup') | |
process.exit() | |
}) |
NewerOlder