Skip to content

Instantly share code, notes, and snippets.

@taiar
taiar / compress.py
Created March 10, 2021 00:24
store dirs internally
from zipfile import ZipFile
import os
import base64
import textwrap
div = "---"
action = "dump"
def get_all_file_paths(directory):
file_paths = []
@taiar
taiar / rearct-native-app-in-wsl2.md
Created January 15, 2021 21:31 — forked from bergmannjg/rearct-native-app-in-wsl2.md
Building a react native app in WSL2
@taiar
taiar / s.sh
Created September 17, 2020 01:48
Grab a patch from a pull request
curl -H 'Authorization: token abcabctodacriancavailereescrever' -H 'Accept: application/vnd.github.VERSION.patch' -L https://api.github.com/repos/google/protobuf/pulls/666
# mean_train_features <- colMeans(data_training[, 1:8])
# sd_train_features <- apply(data_training[, 1:8], 2, sd)
# mean_train_features
# sd_train_features
# data_training[, 1:8] <- sweep(data_training[, 1:8], 2, mean_train_features, "-")
# data_training[, 1:8] <- sweep(data_training[, 1:8], 2, sd_train_features, "/")
# data_validation[, 1:8] <- sweep(data_validation[, 1:8], 2, mean_train_features, "-")
install.packages("Rcpp", dependencies=TRUE, INSTALL_opts = c('--no-lock'))
install.packages("languageserver", dependencies=TRUE, INSTALL_opts = c('--no-lock'))
"Airline Cruise Lines"
"Advertising Services"
"CBD Oil"
"Drop shipping Suppliers"
"Adult"
"Collection Agencies"
"Call Center B2B"
"Product or Tangible Items"
"Credit Repair"
"Firearms"
(ENV['RUBY_VERSION'].gsub(/\W\w/, '').chars - 98.chr.chars).join.capitalize
@taiar
taiar / blabla.md
Created April 27, 2020 12:09
MySQL on WSL

Direct installation of MySQL 8.x will not work on WSL, even after your have selected 8.x as the default install candidate. It has problem starting the server.

Steps below should work (tried out on few WSL instances):

1- Remove MySQL 8.x:

sudo apt-get purge mysql-server mysql-client
sudo apt-get -y autoremove
@taiar
taiar / AutoinstallMYSQL.sh
Created April 27, 2020 11:36 — forked from elialejandro/AutoinstallMYSQL.sh
MySQL 5.7 No directory, logging in with HOME=/
# Install MySQL
mysql_config_file="/etc/mysql/my.cnf"
echo "mysql-server mysql-server/root_password password secret" | sudo debconf-set-selections
echo "mysql-server mysql-server/root_password_again password secret" | sudo debconf-set-selections
apt-get -y install mysql-client mysql-server
sed -i "s/bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" ${mysql_config_file}
usermod -d /var/lib/mysql/ mysql
@taiar
taiar / regreg.reg
Created March 25, 2020 12:09
Remaps CAPS LOCK to Ctrl on Windows 10 (any layout)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00