Skip to content

Instantly share code, notes, and snippets.

@pennz
pennz / notes.md
Created August 10, 2020 12:08
Plan 4 DataViz

worker.postMessage(params); // in the file index (webpage) and the code is : "src": editor.getSession().getDocument().getValue(),

Then we just insert one step to the process, i.e., first code is send to us, we get the code, then we just send back the data in specfic time interval, then the client will show the steps. It is easier for understanding. better if the client can save the history and get the data step forward and backward. -> we can just add button for this. For server it just send back the data. The client can do the thing. No need to keep the long time connection?

Or we can use reflection, reflector, wrap a data structure, and then we inject the code that

def get_entities(sent):
"""get_entities is the fork of https://gist.github.com/prateekjoshi565/241aee30cc95aaf54a3533c2ec0f0b40#file-kg_extract_entities-py, added some comments"""
## chunk 1
ent1 = ""
ent2 = ""
prv_tok_dep = "" # dependency tag of previous token in the sentence
prv_tok_text = "" # previous token in the sentence
prefix = ""

Original Link

code

Entities Extraction

# https://gist.github.com/prateekjoshi565/6439d3d8996aeb490b9d816fa0226e6c#file-kg_dep_parse_eg1-py
@pennz
pennz / extract_cookies.sh
Created May 11, 2020 11:58
Convert firefix cookies to Netscape cookies for wget and curl
#!/bin/sh -e
# Orignal from http://kb.mozillazine.org/Cookies.sqlite
# extract_cookies.sh:
#
# Convert from Firefox's cookies.sqlite format to Netscape cookies,
# which can then be used by wget and curl. (Why don't wget and curl
# just use libsqlite if it's installed?)
# USAGE:
#
@pennz
pennz / nc_tproxy.patch
Created April 4, 2020 02:34
tproxy patch for netcat v1.10 GNU commutiy version
--- a/netcat.c 2018-01-11 22:13:14.000000000 +0000
+++ b/netcat.c 2020-04-04 01:24:53.000042333 +0000
@@ -81,6 +81,10 @@
#include <fcntl.h> /* O_WRONLY et al */
#include <unistd.h>
+/* quick hack to make it working without patched kernel source,
+ for https://sourceforge.net/projects/nc110/files/community%20releases/ */
+#define IP_TRANSPARENT 19
+