Skip to content

Instantly share code, notes, and snippets.

View VitoVan's full-sized avatar
💢
I'm sorry, did I break your concentration?

VitoVan

💢
I'm sorry, did I break your concentration?
View GitHub Profile
@VitoVan
VitoVan / compile.md
Last active February 18, 2024 13:42
Build Pango, Cairo, GLib and the Whole Universe Into Webassembly

Note

The latest version is here:

https://vitovan.com/pango-cairo-wasm/

Build Pango, Cairo, GLib

and the Whole Universe Into Webassembly

Before executing the following commands, you need to follow how-to-build.sh and create two c files, they are provided.

@VitoVan
VitoVan / fuckyou-oracle.md
Last active April 17, 2023 12:22
How to solve TNS-01153 / ORA-12541 / ORA-12514 on Windows

TNS-01153 : Failed to Process the String ...

ORA-12541: TNS: no listener ...

ORA-12514: TNS:listener does not currently know of service requested in connect ...


If you are cursed like me, have to do use Oracle database and Windows, suddenly those shits came out of nowhere and wasted you hours, the following instruction might save you some time:

@VitoVan
VitoVan / exec.py
Created March 27, 2020 09:53
CNVD-2020-10487 Tomcat-Ajp lfi Python POC
#!/usr/bin/env python
# #####################################
#
# Modified from: https://github.com/fairyming/CVE-2020-1938
#
# add `-e` to execute commands
# python exec.py -c 1 127.0.0.1 -p 8009 -f exec.txt -e 'cat /etc/passwd'
#
# ###################################
#CNVD-2020-10487 Tomcat-Ajp lfi
@VitoVan
VitoVan / v2ex-clickonce.js
Created July 21, 2017 09:10
Enable Gift ClickOnce Feature (V2EX)
/*
MIT License
Copyright (c) 2017
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@VitoVan
VitoVan / org-table-align.el
Last active January 28, 2024 12:15
如果你在 orgmode 中使用 table 表格,然后设置了固定宽度 width,然后发现长段落中文隐藏后无法对齐了,那么你可以重定义 org-table-align 函数,以实现中文对齐。
(defun org-table-align ()
"Align the table at point by aligning all vertical bars."
(interactive)
(let* (
;; Limits of table
(beg (org-table-begin))
(end (org-table-end))
;; Current cursor position
(linepos (org-current-line))
(colpos (org-table-current-column))
@VitoVan
VitoVan / dino.lisp
Last active August 22, 2016 03:54
Chrome dino-ai(in-progress)
(defpackage #:dino-ai
(:use #:common-lisp #:cl-autogui)
(:export #:dino-jump
#:dino-play))
(in-package #:dino-ai)
(defvar *f5-key* 71)
(defvar *space-key* 65)
(defvar *down-key* 116)
@VitoVan
VitoVan / dino.lisp
Created August 17, 2016 09:34
Chrome dino-ai (
(defpackage #:dino-ai
(:use #:common-lisp #:cl-autogui)
(:export #:dino-jump))
(in-package #:dino-ai)
(defvar *space-key* 65)
;; game over text position (position of 'G' and 'R')
(defvar *game-over-poses* '((385 175) (575 173)))
@VitoVan
VitoVan / youdao-fanyi.el
Last active September 21, 2017 06:23
有道翻译 Emacs 快捷方式 C-c C-f
(defvar base-youdao-url "http://fanyi.youdao.com/openapi.do?keyfrom=emacs-yd-pub&key=527593631&type=data&doctype=json&version=1.1&q=")
;; Get yourself an API KEY here: http://fanyi.youdao.com/openapi?path=data-mode
(defun youdao-fanyi ()
"Translate current word (en->cn, cn->en), prompt to input if no word here"
(interactive)
(let* ((word (or (thing-at-point 'word) (read-string "Translate> ")))
(full-url (concat base-youdao-url word)))
(with-current-buffer (url-retrieve-synchronously full-url)
(unwind-protect
(progn
@VitoVan
VitoVan / cl-autogui.lisp
Last active May 21, 2021 11:30
GUI automation in Common Lisp. Used to programmatically control the mouse & keyboard and take screenshot etc. (X11 only)
(ql:quickload '(clx zpng))
(defpackage #:cl-autogui
(:use #:common-lisp #:xlib)
(:export #:x-position
#:x-size
#:x-position
#:x-move
#:x-mouse-down
#:x-mouse-up
@VitoVan
VitoVan / shame-of-lisp-in-web.md
Last active March 1, 2023 23:59
Shame of Me

Shame of Me

I accused Clack when I was young.