The aim of this tutorial🔍 is to show a productivity hack I am using when switching between writing and reading markdown (I don’t get images rendered always for markdown preview in VSCode, depending on what folder I am working from)

Image for post
Image for post

1. steps


  • The aim of this tutorial🔍 is to show how to build help for Python functions using docstrings

1. addition of self-documentation to your own module

  • API documentation in Python uses a facility called docstrings

2. provide an example of a function fetching words from an URL

  • use triple-quotes

1. Default values come last

  • rule: argument with default values must come after those without default values
def printMessage(message="Hello World"): print(message)>>> printMessage()
Hello World

2. Default values only on immutables

  • rule: do not use mutable default values; use only immutable default values
  1. ints

  • The aim of this explanation💡 is refactoring the following mess which got accumulated with wanting more and more from checking the status of a Nomad job from PowerShell terminal.

Refactored Code


the case

  • the question is, what is the easiest way of mapping the exact moment of user action to the capture done in process monitor. During the capture
Image for post
Image for post
  • when watching the capture → map the currentmillis with the timestamp of procmon

1. CODE

  • write a function where…

The aim of this how-to🏁 is fixing

verify error:num=20:unable to get local issuer certificate

when running certificate chain verifications using OpenSSL with for example

▶ openssl s_client -connect google.com:443
CONNECTED(00000184)
depth=1 C = US, O = Google Trust Services, CN = GTS CA 1O1
verify error:num=20:unable to get local issuer certificate

1. steps

  1. download cacert.pem provided by curl - Extract CA Certs from Mozilla
Invoke-WebRequest https://curl.se/ca/cacert.pem -OutFile c:\cacert.pem

2. verify again by using -CAfile flag and the absolute path

▶ openssl s_client -connect google.com:443 -CAfile c:\cacert.pemCONNECTED(00000184) depth=2 OU = GlobalSign Root CA - R2, O = GlobalSign, CN = GlobalSign verify…

usecase

  • The aim of this explanation💡 is to provide a code that creates PowerShell and python

… all with a single command with a simple alias; in my workflow, I use pyf and pof for Python and Powershell, respectively

  • For powershell:
Image for post
Image for post
  • For python

  • The aim of this tutorial🔍 is a successful setup of secrets to authenticate a request to Zendesk Help Center API

1. Secret creation

  • Open repo
Image for post
Image for post
  • Open workflow file .\github\workflows\mail.yaml

  • The aim of this tutorial🔍 is to introduce anonymous/lambda functions in Python just to make sure they work in the Higher Order Functions class of SICP

1. syntax

Unlike lambda forms in other languages, where they add functionality, Python lambdas are only a shorthand notation if you’re too lazy to define a function.

Design and History FAQ — Python 3.9.1 documentation

  • restrictive
lambda args: expression
  • multiple args

2. lambda as function expression

  • lambda can be assigned to a binding and thus have “name”
double = lambda x…

The aim of this tutorial🔍 is to offer both a hello-world and a real-world example of a successfully set up and executed JavaScript Github Action.

1. Prerequisites

1.1. Setup a Project (github repo, npm init)

  • create a new repo
Wrote to C:\Users\Admin\Documents\workspace\SNOW\hello-world-javascript-action\package.json:{
"name": "hello-world-javascript-action",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/pkutaj/hello-world-javascript-action.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/pkutaj/hello-world-javascript-action/issues"
},
"homepage": "https://github.com/pkutaj/hello-world-javascript-action#readme"
}

1.2. Add NPM Github Actions Toolkit Packages

  • use npm to install 2 required packages from the toolkit

Pavol Kutaj

today I learnt… | as a support eng of the wonderful Snowplow Analytics, expect everything around modern (postmodern?) business intelligence

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store