Skip to content

Instantly share code, notes, and snippets.

View etherealHero's full-sized avatar

Maxim etherealHero

  • 13:41 (UTC +10:00)
View GitHub Profile
@etherealHero
etherealHero / freezed_isar.dart
Last active May 20, 2024 13:43
freezed & isar & isarLinks
import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:isar/isar.dart';
import 'package:path_provider/path_provider.dart';
part 'test.freezed.dart';
part 'test.g.dart';
@freezed
@Collection(ignore: {'copyWith'})
@etherealHero
etherealHero / fuzzysort-find.md
Created December 22, 2023 02:35
Fuzzysort find word in list
import chalk from 'chalk'
import fuzzysort from 'fuzzysort'

const findWord = 'lorem'
const resource = ['lorem ipsum', 'lorei mpsum', 'ipsum dolor', 'ipsum lor', 'losum remip', 'lor', 'loiem iplor']

console.log(
  [...fuzzysort.go(findWord, resource.map(a => ({title: a})), { keys: ['title'] })]
 .map(a => fuzzysort.highlight(a[0], (m) => chalk.yellow(m)))
@etherealHero
etherealHero / edge-sql.js
Last active December 22, 2023 00:04
NodeJS mssql by edge-js
const edge = require('edge-js');
const getProcedures = edge.func('sql', {
source: "SELECT TOP 10 name FROM sys.procedures",
connectionString: "Persist Security Info=False;Integrated Security=true;Initial Catalog=<database>;server=<server>"
});
const init = async () => {
const res = await new Promise((res, rej) => {
getProcedures(null, function (error, result) {
@etherealHero
etherealHero / .vimrc
Last active July 2, 2024 22:59
.vimrc_configuration
" vim-bootstrap 2024-07-02 04:39:38
"*****************************************************************************
"" Vim-Plug core
"*****************************************************************************
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
if has('win32')&&!has('win64')
let curl_exists=expand('C:\Windows\Sysnative\curl.exe')
else
let curl_exists=expand('curl')