Skip to content

Instantly share code, notes, and snippets.

View hoyang's full-sized avatar
🐉
Sad

H. Y hoyang

🐉
Sad
View GitHub Profile
@hoyang
hoyang / wstring2hex.cpp
Last active October 27, 2018 09:49
wstring to hex, hex to wstring
int encode(std::string* t, std::wstring s)
{
std::wcout.imbue(std::locale("russian_russia.866"));
std::wcout << L"ENCODE: строка до:\t\t" << s << std::endl;
size_t i_len = s.length();
std::stringstream ss;
std::wcout << L"ENCODE: Длина строки:\t\t" << i_len << std::endl;
@hoyang
hoyang / gnome3-app-folder.py
Created April 9, 2017 21:13
Python script to create GNOME 3 App Folder
#!/usr/bin/python3
import sys, os, json
class AppFolderMgr:
dconf_prefix = 'gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/'
def __init__(self):
self.folder_tree = {
"Utilities": ['catfish.desktop',
@hoyang
hoyang / dict.el
Created March 22, 2017 05:00
Emacs dictionary, translate english to chinese or chinese to english
;; sudo apt-get install sqlite3
;; download dict.db from:
;; https://www.dropbox.com/sh/u3r3q66x03vqxxy/AAACXdrMy2yxVrwwn1gahQXqa?dl=0
;; put dict.db to ~/.emacs.d/data/dict.db
(defun my-simple-dictionary ()
(interactive)
(defvar sqlite-program
(or (executable-find "sqlite3")
(executable-find "sqlite")