Skip to content

Instantly share code, notes, and snippets.

View Dev-iL's full-sized avatar

Dev-iL

  • Israel
  • 14:26 (UTC +03:00)
View GitHub Profile
@Dev-iL
Dev-iL / file_tree_builder.py
Last active June 19, 2024 12:09 — forked from dormeir999/Streamlit_Files_explorer.py
Streamlit_Files_explorer.py
import os
import shutil
import sys
from pathlib import Path
import streamlit as st
from streamlit import session_state as state
_TEE: str = "├── "
_BRANCH: str = "│ "
@Dev-iL
Dev-iL / _streamlit_cell_click_callback.md
Last active November 28, 2024 21:03
Cell click callback workaround in Streamlit 1.36.0 dataframes

Below are my attempts at creating a mechanism to inform Streamlit which specific cell was selected in a dataframe/data_editor. I'm sharing my solution in hope that someone could improve it.


TL;DR: we create a hidden Streamlit control and programmatically interact with it from the JS side. Then, when the callback fires, we retrieve the payload and process it in the "proper" Streamlit flow.

To try it out - run working_workaround.py as a python script (not via streamlit run ...!).


@Dev-iL
Dev-iL / _add-JS-Lib-To-UIFigure.md
Last active November 10, 2021 08:56
Adding an arbitrary .js library to your uifigure during runtime (R2018a)

fancy

This gist demonstrates how we can attach the D3 library, provided as a remote .js file, to our uifigure and use it to create some interesting visualizations. The JS code in this example is taken almost verbatim from the Particles example, found inside the D3 example gallery.

Instructions:

  1. Save the three code files (.m, .js, .css) in the same folder, and execute the MATLAB script.
  2. If there is some error such as
    Error using matlab.internal.webwindow/executeJS (line 730)
    

Error executing JavaScript command:

@Dev-iL
Dev-iL / _jsEventDemo.md
Last active November 1, 2020 21:29
Hijacking uicontrols to do our bidding...

In this example I demonstrate how we can respond to JS events within MATLAB. Here's a preview of what is possible using this approach:

demoNum = 4

Take a look at the code below, which was tested on R2018a. Please save all files in the same folder, and run it using jsEventDemo(demoNum), where demoNum is 1...4.

function varargout = jsEventDemo(demoNum)
%% Handle inputs and outputs
if ~nargin

In this document I'm going to discuss how to get a AWUS036ACH wifi adapter up and running in monitor mode in Kali Linux 2017.2.

  1. Clean install Kali 2017.2.

  2. Upgrade packages:

This is required mostly to update the linux headers so that we can build the driver we download afterwards.

apt update