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
highlight clear | |
let colors_name = "rhighs" | |
function s:highlight(group, bg, fg, style) | |
let gui = a:style == '' ? '' : 'gui=' . a:style | |
let fg = a:fg == '' ? '' : 'guifg=' . a:fg | |
let bg = a:bg == '' ? '' : 'guibg=' . a:bg | |
exec 'hi ' . a:group . ' ' . bg . ' ' . fg . ' ' . gui | |
endfunction |
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 math, numpy as np | |
from typing import Tuple, Callable | |
from numpy.typing import ArrayLike | |
x_train = np.array([1.0, 2.0]) | |
y_train = np.array([300.0, 500.0]) | |
def compute_cost(x: ArrayLike, y: ArrayLike, w: float, b: float) -> float: | |
m = x.shape[0] | |
cost = 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 crypto from "crypto"; | |
let randGenData = { | |
index: 0, | |
bytes: [], | |
poolSize: 512 | |
}; | |
// Generates a word by [' ', ~) from https://www.asciitable.com/ | |
const genRandPass = (length) => { |
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
" https://github.com/neoclide/coc.nvim#example-vim-configuration | |
inoremap <silent><expr> <c-space> coc#refresh() | |
" gd - go to definition of word under cursor | |
nmap <silent> gd <Plug>(coc-definition) | |
nmap <silent> gy <Plug>(coc-type-definition) | |
" gi - go to implementation | |
nmap <silent> gi <Plug>(coc-implementation) |
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
const ofClass = (classDef, instance) => { | |
if (typeof classDef === 'function' | |
&& typeof instance === 'object') { | |
return new classDef().constructor === instance.constructor | |
} | |
if (classDef === Number) | |
return typeof instance === 'number' | |
if (classDef === String) | |
return typeof instance === 'string' |
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
/** | |
* Merges two arrays by concatenating their elements uniquely using `new Set(...)`. | |
* | |
* @param {Array} a1 - The first array to merge. | |
* @param {Array} a2 - The second array to merge. | |
* @returns {Array} A new array containing elements from both input arrays. | |
*/ | |
const mergeArray = (a1, a2) => Array.from(new Set([...a1, ...a2])) | |
/** |
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
#!/bin/bash | |
git clone https://github.com/cilynx/rtl88x2bu.git | |
cd rtl88x2bu | |
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf) | |
sudo rsync -rvhP ./ /usr/src/rtl88x2bu-${VER} | |
sudo dkms add -m rtl88x2bu -v ${VER} | |
sudo dkms build -m rtl88x2bu -v ${VER} | |
sudo dkms install -m rtl88x2bu -v ${VER} | |
sudo modprobe 88x2bu |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
typedef bool b8; | |
typedef unsigned int u32; | |
struct _None {}; | |
#define None (_None{}); | |
template<typename T> | |
struct Option { |
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
{ | |
"$schema": "https://zed.dev/schema/themes/v0.1.0.json", | |
"name": "Darkened", | |
"author": "Roberto Montalti", | |
"themes": [{ | |
"name": "Darkened", | |
"appearance": "dark", | |
"style": { | |
"background.appearance": "opaque", |
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
remind () | |
{ | |
if [ $1="-h" ] || [ $1="--help" ]; then | |
echo "usage: remind <command_prefix>" | |
return 0 | |
fi | |
if [ -z "$1" ]; then | |
echo "usage: remind <command_prefix>">&2 | |
return 1 |