Skip to content

Instantly share code, notes, and snippets.

View bitnot's full-sized avatar
👁️
~

Pavel bitnot

👁️
~
View GitHub Profile
@rena2019
rena2019 / IDwalletFail.md
Last active October 30, 2021 16:30
IDwallet Fails

Die schönsten #IDWallet Fehlermeldungen

Rechtzeitig vor der Bundestagswahl 2021 hat uns die Bundesregierung ein neues digitales Spielzeug bereitgestellt, den Prototypen der #ID Wallett App https://www.bundesregierung.de/breg-de/aktuelles/e-id-1962112

  1. Anfrage #229623: ID Wallet https://fragdenstaat.de/anfrage/id-wallet/
@melvic-ybanez
melvic-ybanez / what-i-didnt-know-about-fp-2020.md
Last active August 1, 2024 08:25
What I Didn't Know about Functional Programming until 2020

What I Didn't Know about Functional Programming until 2020

  1. Programming using a series of transformations and aggregations, something I've been doing for years, is known as programming in the map/reduce style.
  2. The more abstract the type is, the greater its cardinality, and the smaller the set of operations it supports. So make use of universal quantifiers, particularly by implementing fully parametric functions. They guide you on how to implement their term-level definitions by narrowing down the number of possible implementations. In other words, the type system of Scala (or Haskell, for that matter) is not only great for capturing compile-time errors, but is also capable of leading you to the correct solution.
  3. You can encode union types by combining different Scala features such as type constructors, subtyping and implicits, and by taking advantage of the Curry-Howard Isomorphism and De Morgan's Laws for neg
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var domStyle = document.createElement("style");
domStyle.append(
'* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
* * * { background-color: rgba(0,0,255,.2) !important; }\
* * * * { background-color: rgba(255,0,255,.2) !important; }\
* * * * * { background-color: rgba(0,255,255,.2) !important; }\
@japgolly
japgolly / upgrade.md
Last active April 26, 2022 02:55
Scala 2.13 migration notes

scalafix

addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.13")
import scalafix.sbt.ScalafixPlugin.autoImport.{scalafixDependencies, scalafixSemanticdb}

scalafixDependencies in ThisBuild += "org.scala-lang.modules" %% "scala-collection-migrations" % "2.1.4",
@bitnot
bitnot / kmsdecode.sh
Created April 8, 2019 15:11
Decrypt Base64-encoded KMS secret. Output base-64 encoded plaintext value.
alias kmsdecode='f(){aws kms decrypt --ciphertext-blob fileb://<(echo $1 | base64 --decode) --output text --query Plaintext }; f'
@dideler
dideler / bot.rb
Last active September 16, 2024 07:31
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@peteryates
peteryates / guide.md
Last active August 25, 2024 11:30
How to stop adverts appearing on your Samsung TV

I'm getting adverts in my TV's UI, help!

Samsung's otherwise excellent 2016 range of UHD TVs received an update that added advertisements to the UI. This has been complained about at great length on Samsung's forums and repeatedly, Samsung have refused to add an option to remove them.

The ads interrupt the clean UI of the TV and are invasive. Here's an example of how they look:

one two

This guide was originally posted on Samsung's TV forums but unfortunately, that site is a super-slow and barely accessible unusable mess.

@DanyMariaLee
DanyMariaLee / parsewiki.scala
Last active June 23, 2018 02:00
Parsing html with #scala-scraper
package ms.podium.services
import scala.util.Try
import net.ruippeixotog.scalascraper.browser.JsoupBrowser
import net.ruippeixotog.scalascraper.dsl.DSL.Extract._
import net.ruippeixotog.scalascraper.dsl.DSL._
/*
Yet another example of scala-scrapper usage.
@Nikolay-Lysenko
Nikolay-Lysenko / xgb_quantile_loss.py
Last active October 25, 2023 13:26
Customized loss function for quantile regression with XGBoost
import numpy as np
def xgb_quantile_eval(preds, dmatrix, quantile=0.2):
"""
Customized evaluational metric that equals
to quantile regression loss (also known as
pinball loss).
Quantile regression is regression that
@Kmaschta
Kmaschta / pre-commit
Last active November 16, 2022 19:35
Pre-commit hook (warn if you have it.only, describe.only, fit or fdescribe)
#!/bin/bash
SRC=$(git rev-parse --show-toplevel)
EXCLUDE="--exclude-dir 'node_modules' --exclude-dir '.git'"
#==========================================================
# Check if I forgot to remove 'only' keyword from tests.
# To make sure that before commit run all tests
only_command="grep -c -h -r $EXCLUDE -E \"(describe|it)\.only\" $SRC | awk -F ':' '{x +=\$0}; END {print x}'"
fonly_command="grep -c -h -r $EXCLUDE -E \"f(it|describe)\(\" $SRC | awk -F ':' '{x +=\$0}; END {print x}'"
only=`eval $only_command`