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
| cmd /c mklink "$LOCALAPPDATA\Microsoft\WindowsApps\edit" "C:\Program Files (x86)\Notepad++\notepad++.exe" |
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
| // val e = (1 to 10 toList).mkString(",") | |
| import org.apache.spark.sql.types._ | |
| import org.apache.spark.sql.types.{DoubleType, StringType, StructField, StructType} | |
| import org.apache.spark.sql.{Row, SparkSession} | |
| // 2019-12-10 16:06:40,135 cask datab 0012 REST TRACE [com.kortlet.IEnferinend] (ajp-/192.168.0.1:8009-77) Invoke End | |
| val regexRestBase = """(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2},\d{3})[\s\t]+(\w+)[\s\t]+(\w+)[\s\t]+(\d+)[\s\t]+(\w+)[\s\t]+(\w+)[\s\t](\[[\w\.]+\])[\s\t]+(\(.*\))[\s\t]+(.*)""".r |
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 | |
| LOCAL_DIR=~/ | |
| PROGRAM_NAME=my-jar-exe | |
| HOST=$(hostname | cut -d "." -f 1) | |
| PROGRAM_PIDS=$(jps -v | grep $PROGRAM_NAME | cut -d " " -f 1) | |
| function insert_sqlite { | |
| FILE=$2 |
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
| static <T, E extends Exception> Consumer<T> handlingConsumerWrapper( | |
| ThrowingConsumer<T, E> throwingConsumer, Class<E> exceptionClass) { | |
| return i -> { | |
| try { | |
| throwingConsumer.accept(i); | |
| } catch (Exception ex) { | |
| try { | |
| E exCast = exceptionClass.cast(ex); | |
| System.err.println( |
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
| # Install protobuf | |
| brew install protobuf | |
| brew install swift-protobuf | |
| flutter pub global activate protoc_plugin | |
| echo ' | |
| # Flutter binaries | |
| export FLUTTER_HOME="$HOME/work/apps/flutter" | |
| export DART_HOME="$FLUTTER_HOME/bin/cache/dart-sdk" | |
| export PATH="$PATH":"$FLUTTER_HOME/bin":"$FLUTTER_HOME/.pub-cache/bin":"$DART_HOME/bin"' > $HOME/.bashrc |
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
| ls -lap | grep -v / | awk '{ | |
| size = size + $5; | |
| } | |
| END { | |
| print size/1024 | |
| }' |
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
| @echo off | |
| SETLOCAL | |
| if "%1%"=="" ( | |
| echo Please, fill JDK exe installer as first parameter | |
| exit /B | |
| ) | |
| set z7="C:\Program Files\7-Zip\7z.exe" |
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
| COMPANY_CERT=certnew | |
| COMPANY_CERT_ORIGINAL=${COMPANY_CERT}.p7b | |
| COMPANY_CERT_NAME=company_certificates.cer | |
| COMPANY_CERT_PKCS7_DER=${COMPANY_CERT}.der.p7b | |
| COMPANY_CERT_PKCS7_PEM=${COMPANY_CERT}.pem.p7b | |
| PRIVATE_KEY=private | |
| PRIVATE_KEY_LEN=2048 | |
| PUBLIC_KEY_EXPIRY_DAYS=365 | |
| PUBLIC_KEY=public | |
| CERTIFICATE_REQUEST=request |
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
| -- Exercise 6.4: Write a function to shuffle a given list. Make sure that all permutations are equally probable. | |
| function q4(...) | |
| items = table.pack(...) | |
| itemsr = {} | |
| for i=1,#items do | |
| math.randomseed(os.time()) | |
| pick = math.random(#items) | |
| print("Picked item:", pick) | |
| table.insert(itemsr,items[pick]) | |
| table.remove(items, pick) |