Skip to content

Instantly share code, notes, and snippets.

View krasnobaev's full-sized avatar
👨‍🔬

Aleksey Krasnobaev krasnobaev

👨‍🔬
View GitHub Profile
@krasnobaev
krasnobaev / tsrfc.tsx
Created November 9, 2024 14:27
tsrfc.tsx
import React from 'react'
type Props = {
className?: string;
children: React.ReactNode;
}
const FBNumericInput: React.FC<Props> = ({
className,
children,
@krasnobaev
krasnobaev / docker.yml
Created October 22, 2024 22:48
cloud-init
#cloud-config
packages:
- docker.io
groups:
- docker
system_info:
default_user:
groups: [docker]
#![warn(
clippy::all,
clippy::restriction,
clippy::pedantic,
clippy::nursery,
// clippy::cargo,
)]
#![allow(clippy::missing_docs_in_private_items)]
#![allow(clippy::print_stdout)]
#![allow(clippy::print_stderr)]
@krasnobaev
krasnobaev / auth.vbs
Created June 10, 2024 02:11
microsoft VBS user automation
set shell=wscript.createobject("Wscript.shell")
Wscript.Sleep 3000
shell.sendkeys "user_name"
Wscript.Sleep 500
shell.sendkeys "{TAB}"
Wscript.Sleep 500
shell.sendkeys "pass_word"
Wscript.Sleep 500
shell.sendkeys "{ENTER}"
@krasnobaev
krasnobaev / list.sh
Created April 26, 2023 15:46
generate source code listing
#!/bin/sh
# usage: scriptname file1 file2 ...
# find . -name '*' | sort | xargs ./list.sh {} \; > ../listing.txt
for file in "$@"
do
[ -f "$file" ] || continue
set -- `wc "$file"`
echo "${file}: lines $1 words $2 bytes $3"
cat -b -t "$file"
@krasnobaev
krasnobaev / .gitconfig
Last active October 24, 2024 21:34
Basic server env
[init]
defaultBranch = main
[user]
email = [email protected]
name = User Name
[alias]
set-upstream = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
[push]
autoSetupRemote = true
[credential]
// Hello world! Cplayground is an online sandbox that makes it easy to try out
// code.
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <time.h>
using namespace std;
@krasnobaev
krasnobaev / deploy.bash
Last active March 6, 2020 07:32
hana express deployment
SOURCE https://developers.sap.com/tutorials/hxe-ua-install-using-docker.html
# Step 4: Download the SAP HANA, express edition Image from the Docker Library
```bash
docker login
docker pull store/saplabs/hanaexpressxsa:2.00.045.00.20200121.1
```
# Step 5: Edit the host sysctl.conf file and reboot to apply changes
```bash
@krasnobaev
krasnobaev / main.md
Last active May 16, 2019 18:17
talk-2019-wasmjsbundlers
@krasnobaev
krasnobaev / homedirectoryforuser.js
Last active July 8, 2018 19:47 — forked from TooTallNate/objc.js
Experimentations with node-ffi
// https://developer.apple.com/documentation/foundation/nsfilemanager/1642853-homedirectoryforuser
var ffi = require('ffi');
var objc = new ffi.Library(null, {
'objc_getClass': [ 'pointer', [ 'string' ] ],
'sel_registerName': [ 'pointer', [ 'string' ] ],
'objc_msgSend': [ 'pointer', [ 'pointer', 'pointer' ] ]
});
var objc2 = new ffi.Library(null, {
'objc_msgSend': [ 'string', [ 'pointer', 'pointer' ] ]
});