Skip to content

Instantly share code, notes, and snippets.

View krasnobaev's full-sized avatar
👨‍🔬

Aleksey Krasnobaev krasnobaev

👨‍🔬
View GitHub Profile
@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 February 8, 2024 15:53
Basic server env
[init]
defaultBranch = main
[user]
email = user@mail.org
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' ] ]
});
@krasnobaev
krasnobaev / setup.sh
Last active March 30, 2018 19:46
setup script
#!/bin/bash
apt install -Y git zsh wget openssh
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
echo "set -g @plugin 'tmux-plugins/tpm'" >> ~/.tmux.conf
echo "set -g @plugin 'tmux-plugins/tmux-sensible'" >> ~/.tmux.conf
echo "run '~/.tmux/plugins/tpm/tpm'" >> ~/.tmux.conf
@krasnobaev
krasnobaev / fetchtracks.js
Created February 6, 2017 21:30
work with audio
/*
Trackid – 0 : "456239225"

ownerid – 1 : "212204800"

? – 2 : ""

track name – 3 : "Emotion"

track artist – 4 : "FGFC820"

? – 5 : 313

album id – 6 : 83025823

? – 7 : 0

? – 8 : ""

@krasnobaev
krasnobaev / sapui5.js
Last active October 20, 2017 07:34
sapui5 helpers
$$$=(id)=>sap.ui.getCore().byId(id);
$$$.showModels=o=>(ret={},Object.keys(o.oPropagatedProperties.oModels).map(el=>ret[el]=((o.oPropagatedProperties.oModels[el].getData)?o.oPropagatedProperties.oModels[el].getData():{})),ret);
l = $$$('__item7220');
$$$.showModels(l);
/* */
$$$=(id)=>sap.ui.getCore().byId(id);
$$$.showModels=o=>(
ret={},
FROM ubuntu:16.10
MAINTAINER Aleksey Krasnobaev <https://github.com/krasnobaev>
# https://www.digitalocean.com/community/tutorials/docker-explained-how-to-containerize-python-web-applications
RUN apt-get update ; \
DEBIAN_FRONTEND=noninteractive apt-get -y install python python-dev python-distribute python-pip \
wget git
# following instructions in https://explosion.ai/blog/chatbot-node-js-spacy