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
{{#each messages }} | |
<div role="alert" | |
class="animate-duration-200 animate-ease-in animate-fill-both animate-normal animate-flip-down alert | |
{{#if (eq alert_type "info")}}alert-info{{/if}} | |
{{#if (eq alert_type "error" )}}alert-error{{/if}} | |
{{#if (eq alert_type "success")}}alert-success{{/if}} | |
{{#if (eq alert_type "warning" )}}alert-warning{{/if}}" | |
style="margin-bottom: 0.5rem;"> | |
{{#if (eq alert_type "error")}} |
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
--[[ | |
lvim is the global options object | |
Linters should be | |
filled in as strings with either | |
a global executable or a path to | |
an executable | |
]] | |
-- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT |
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
:inoremap <C-e> <C-o>$ | |
:inoremap <C-a> <C-o>0 | |
" https://medium.com/better-programming/setting-up-neovim-for-web-development-in-2020-d800de3efacd | |
" https://jdhao.github.io/2018/12/24/centos_nvim_install_use_guide_en/#the-difference-between-nvim-and-vim | |
" curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ | |
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
call plug#begin('~/.local/share/nvim/plugged') |
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
from typing import Dict, List | |
import aiohttp | |
import asyncio | |
import time | |
JOKE_URL = "http://api.icndb.com/jokes/random" | |
async def download_joke(session: aiohttp.ClientSession) -> Dict[str, str]: |
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
def _read_private_key(self, tag, f, password=None): | |
lines = f.readlines() | |
start = 0 | |
beginning_of_key = "-----BEGIN " + tag + " PRIVATE KEY-----" | |
while start < len(lines) and lines[start].strip() != beginning_of_key: | |
start += 1 | |
if start >= len(lines): | |
raise SSHException("not a valid " + tag + " private key file") | |
# parse any headers first | |
... |
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
if not two_factor: | |
for key_filename in key_filenames: | |
for pkey_class in (RSAKey, DSSKey, ECDSAKey, Ed25519Key): | |
try: | |
key = self._key_from_filepath( | |
key_filename, pkey_class, passphrase | |
) | |
allowed_types = set( | |
self._transport.auth_publickey(username, key) | |
) |
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
from typing import Dict, List | |
def some_func(value: str, data: List = []) -> Dict or List[str]: | |
data.append(value) | |
return data | |
d = some_func("test") | |
some_func("test2", d) | |
print(d) |
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
# print only nth column from output | |
ps ax | awk '{printf "%s\n", $5}' | |
zsh | |
ps | |
tail | |
awk | |
# join each line with "," | |
cat file.txt | awk '{printf (NR>1?",":"") $0}' |
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
import click | |
from subprocess import run | |
import os | |
@click.command() | |
@click.argument("source_repo", type=str) | |
@click.argument("source_branch", default="master", type=str) | |
@click.argument("target_repo", type=str) | |
@click.argument("target_directory", type=str) |
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
""" | |
Version retrieving. | |
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. |
NewerOlder