Skip to content

Instantly share code, notes, and snippets.

View cybaj's full-sized avatar

Minseok Kim cybaj

View GitHub Profile

Logseq Plugin Setup Guide

[WIP] Logseq Plugin System is currently under Alpha Testing phase.

For Developers

In this short guide, it will walk you through the steps needed to set up your development environment for writing and running a hello world simple inside of Logseq Desktop Client. You know Logseq Plugin based on Web Technologies composed of JS & HTML & CSS, but neither are mandatory, you can develop plugins use any language which can be translated to javascript (Logseq made by Clojurescript!). We will use Typescript to demonstrate this sample. Because there is a type definition file to make development experience even better.

Install Node.js and NPM

// 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 elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}

Libuv and libev, two I/O libraries with similar names, recently had the privilege to use both libraries to write something. Now let's talk about my own subjective expression of common and different points.

The topic of high-performance network programming has been discussed. Asynchronous, asynchronous, or asynchronous. Whether it is epoll or kqueue, it is always indispensable to the asynchronous topic.

Libuv is asynchronous, and libev is synchronous multiplexing IO multiplexing.

Libev is a simple encapsulation of system I/O reuse. Basically, it solves the problem of different APIs between epoll and kqueuq. Ensure that programs written using livev's API can run on most *nix platforms. However, the disadvantages of libev are also obvious. Because it basically just encapsulates the Event Library, it is inconvenient to use. For example, accept(3) requires manual setnonblocking after connection. EAGAIN, EWOULDBLOCK, and EINTER need to be detected when reading from a socket. This is a

{
"Afghanistan":[
"China",
"Iran",
"Pakistan",
"Tajikistan",
"Turkmenistan",
"Uzbekistan"
],
"Albania":[
@trx1138
trx1138 / mkv2srt-syno.sh
Created March 3, 2018 03:16
extract srt from mkv container with ffmpeg (for synology)
#!/bin/bash
# Extract subtitles from each MKV file in the given directory
# If no directory is given, work in local dir
if [ "$1" = "" ]; then
DIR="."
else
DIR="$1"
fi
@HarshaVardhanBabu
HarshaVardhanBabu / Instructions_UML_Python.rst
Last active July 16, 2024 11:34
Generating UML diagrams in python using pyreverse

Requirements

  1. Install Pylint from Install. If you have anaconda already installed use pip install -U pylint to update the Pylint so that pyreverse is added to the scripts folder.

  2. You need to install Graphviz as the pyreverse generates the UML diagrams in dot format and needs the dot.exe provided by Graphviz. Once Graphviz is installed make sure the bin folder is added to the PATH variable so that pyreverse can find it at run time. "the command pyreverse generates the diagrams in all formats that graphviz/dot knows." (Reference

  3. Now add the path of python modules for which you want to generate the documentation to PYTHONPATH.

  4. Use pyreverse -S <modulename> to generate dot files in the current folder

    Usage:

@VirajKanse
VirajKanse / gist:1c0db872cd7685632c02f8826397f190
Last active June 21, 2024 04:16
GCC / Clang C/C++ Compiler On Android Using Termux (Linux Environment)
Install Termux App.
type "apt update"
Then We have to install a text editor to write our code so type "apt install vim" for vim text editor
or u can also use nano text editor for nano type "apt install nano"
Now Clang Installation type "apt install clang" and wait for download completes.
now to create a file simply type vim filename.c or .cpp or nano filename.c or cpp
then u will able to write ur code .
write.....to save ur code simply press esc then type ":wq"
now code is ready to compile
type "clang filename.c -o filename"
@guillaume-chevalier
guillaume-chevalier / tensorflow-simple-second-order-optimization.py
Created July 30, 2017 04:58
Simple second order optimization with TensorFlow.
"""Simple second order optimization with TensorFlow."""
import tensorflow as tf
####
# 1. Define the problem
@KennethanCeyer
KennethanCeyer / amd_commonjs_module_supports.js
Created March 4, 2017 22:55
Supporting AMD and CommonJS, and Plaintype.
(function(root, factory) {
if(typeof define !== 'undefined' && define.amd) {
// AMD loader type declaration.
define(['jquery', 'moment'], function(jquery, moment) {
factory(window, document, jquery, moment);
});
} else if(typeof module === 'object') {
var jsdom = require('jsdom').jsdom;
var _document = jsdom('<html></html>', {});
var _window = _document.defaultView;