Skip to content

Instantly share code, notes, and snippets.

View stekhn's full-sized avatar

Steffen Kühne stekhn

View GitHub Profile
@oliverjumpertz
oliverjumpertz / simple-linear-regression.js
Created January 5, 2021 19:49
Simple linear regression implemented in JavaScript
const inputArray = [
{
squareMeters: 200,
priceInDollars: 190000
},
{
squareMeters: 100,
priceInDollars: 90000
},
{
@dannylinden
dannylinden / gist:3736a612b5ab47928c97c1d8e8dbece9
Created June 26, 2020 11:41
Show Corona-Warn-App Warning Data
brew install leveldb python3 \
&& curl -L https://github.com/mh-/diagnosis-keys/archive/master.zip --output diagnosis-keys.zip \
&& unzip diagnosis-keys.zip \
&& cd diagnosis-keys-master \
&& pip3 install -r requirements.txt \
&& curl https://svc90.main.px.t-online.de/version/v1/diagnosis-keys/country/DE/date/2020-06-26/hour/10 --output 2020_06_26_10 \
&& ./parse_keys.py -d 2020_06_26_10
@JLChnToZ
JLChnToZ / _readme.md
Last active April 17, 2024 04:12
Simple bookmarklet that captures any webpage and save as png image using HTML5 technologies

Webpage Snapshot Bookmarklet

This is a simple bookmarklet that captures any webpage and save as png image using HTML5 technologies. Under the hood it uses HTML2Canvas to capture the webpage to canvas, then we convert the content inside this canvas element to image file.

You may copy the text below and save as bookmark. `javascript:!function()%7Bfunction%20e()%7Bthis&&this.parentNode&&this.parentNode.removeChild(this),html2canvas(document.body).then(function(e)%7Breturn%20new%20Promise(function(t)%7Be.toBlob(t)%7D)%7D).then(function(e)%7Bvar%20t=document.createElement(%22a%22);return%20t.href=URL.createObjectURL(e),t.download=document.title.replace(/%5B/%5C%7C%5C%5C%60~!@#%5C$%25%5C%5E&%5C*%5C+%5C-='%22%5C,%5C.:;%5D+/g,%22%22)+%22_%22+(new%20Date).getTime()+%22.png%22,t.click(),new%20Promise(function(e)%7BsetTimeout(10,e,t)%7D)%7D).then(function(e)%7B0===e.href.indexOf(%22blob:%22)&&(URL.revokeObjectURL(e.href),e.href=%22###%22)%7D).catch(function(e)%7Bconsole.error(e)

@unoexperto
unoexperto / patch_apk_for_sniffing.md
Last active May 13, 2024 04:15
How to patch Android app to sniff its HTTPS traffic with self-signed certificate

How to patch Android app to sniff its HTTPS traffic with self-signed certificate

  • Download apktool from https://ibotpeaches.github.io/Apktool/
  • Unpack apk file: java -jar /home/expert/work/tools/apktool.jar d net.flixster.android-9.1.3@APK4Fun.com.apk
  • Modify AndroidManifest.xml by adding android:networkSecurityConfig="@xml/network_security_config" attribute to application element.
  • Create file /res/xml/network_security_config.xml with following content:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config>
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@1wheel
1wheel / README.md
Last active December 29, 2017 13:46
regl-tax-scatter
@mdo
mdo / 00-intro.md
Last active March 24, 2024 08:04
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

/**
* Escrapear datos desde la consola con javascript
*/
var wrap = document.querySelectorAll("div#contenido > div")[5];
var tables = wrap.querySelectorAll("table tbody");
var data = [];
tables.forEach(function(t){
var r = [];
t.querySelectorAll("td").forEach(function(txt){
@hallettj
hallettj / Makefile
Last active December 10, 2023 13:32
Makefile for transpiling with Babel & Flow in a Node app, or in a client- or server-side shared library
# Makefile for transpiling with Babel in a Node app, or in a client- or
# server-side shared library.
.PHONY: all clean
# Install `babel-cli` in a project to get the transpiler.
babel := node_modules/.bin/babel
# Identify modules to be transpiled by recursively searching the `src/`
# directory.
@adamterlson
adamterlson / Propsal.md
Last active October 24, 2021 16:59
Lightning talk proposal for the Reactive 2016 Conference: Reconceptualizing react applications as a function

Lightning talk proposal for the Reactive 2016 Conference. Here's a handy retweet link

If you want to hear this talk, or if you just want to support me, please star ⭐ the Gist!

When I started writing React apps, I approached components as if they were “just the V in MVC!” Seriously, we’ve all heard it.

I have found this to be an inferior way of thinking about and building React applications. It makes people treat React as a drop-in replacement for something like a Backbone or Angular 1.x View. In other words, people treat it like a glorified template system with partials and don’t harness the power of its functional paradigms.

This talk is about a functional way to write and conceptualize entire React applications.