Skip to content

Instantly share code, notes, and snippets.

View lethean's full-sized avatar
🎯
Focusing

Sunjin Yang lethean

🎯
Focusing
View GitHub Profile
@lethean
lethean / Cargo.toml
Last active January 14, 2021 04:02
Convert CSV to Excel using Rust
[package]
name = "csv2xlsx"
version = "0.1.0"
authors = ["Sunjin Yang"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
csv = "1.1.5"
@lethean
lethean / git-init-config.sh
Created May 12, 2017 06:34
Initialize default git configuration
#!/bin/sh
git_set() {
git config --global "$1" "$2"
}
#git_set user.name "$1"
#git_set user.email "$2"
# Set default editor
@lethean
lethean / libui-win32-build-error-with-resources-res.patch
Created December 19, 2016 02:14
fix libui build error in win32 due to resources.res
diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt
index 4695eb4..df7d838 100644
--- a/windows/CMakeLists.txt
+++ b/windows/CMakeLists.txt
@@ -65,14 +65,14 @@ set(_LIBUI_INCLUDEDIRS _LIBUI_INCLUDEDIRS PARENT_SCOPE)
# Windows won't link resources in static libraries; we need to provide the libui.res file in this case.
set(_LIBUINAME libui PARENT_SCOPE)
if(NOT BUILD_SHARED_LIBS)
- set(_LIBUI_STATIC_RES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libui.res PARENT_SCOPE)
+ set(_LIBUI_STATIC_RES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/$(Configuration)/libui.res PARENT_SCOPE)
@lethean
lethean / eject.c
Created October 24, 2016 08:45
Simple CD-ROM Eject
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/cdrom.h>
int
main (int argc,
char **argv)
@lethean
lethean / clutter-event-win32-ime.patch
Last active August 31, 2016 05:31
Clutter Win32 IME(Input Method Editor) Patch
diff --git a/clutter.orig/win32/clutter-event-win32.c b/clutter/win32/clutter-event-win32.c
index 7a360c6..6b1fedc 100644
--- a/clutter.orig/win32/clutter-event-win32.c
+++ b/clutter/win32/clutter-event-win32.c
@@ -288,7 +288,10 @@ clutter_event_dispatch (GSource *source,
the clutter event queue */
while (!clutter_events_pending () && PeekMessageW (&msg, NULL,
0, 0, PM_REMOVE))
+ {
+ TranslateMessage (&msg); /* needed for WM_IME_CHAR */
@lethean
lethean / tigervnc-vncviewer-password-text-param.patch
Created April 25, 2016 05:56
TigerVNC vncviewer `-PasswordText` parameter added
diff --git a/vncviewer/UserDialog.cxx b/vncviewer/UserDialog.cxx
index b57588d..287f790 100644
--- a/vncviewer/UserDialog.cxx
+++ b/vncviewer/UserDialog.cxx
@@ -61,10 +61,18 @@ UserDialog::~UserDialog()
void UserDialog::getUserPasswd(char** user, char** password)
{
+ CharArray passwordTextStr(passwordText.getData());
CharArray passwordFileStr(passwordFile.getData());
@lethean
lethean / rr272x_1x-fix-irq-routing-failure.patch
Last active March 8, 2016 03:37
Fix IRQ routing failure of HighPoint RAID driver rr272x_1x in Linux 4.3 and 4.4 versions (http://www.highpoint-tech.com/USA_new/series_rr272x_configuration.htm)
diff --git a/drivers/rr272x/osm/linux/osm_linux.c b/drivers/rr272x/osm/linux/osm_linux.c
index d46ed92..aa5b5f5 100644
--- a/drivers/rr272x/osm/linux/osm_linux.c
+++ b/drivers/rr272x/osm/linux/osm_linux.c
@@ -29,21 +29,6 @@ static int hpt_init_one(HIM *him, struct pci_dev *pcidev)
PVBUS vbus;
PVBUS_EXT vbus_ext;
int order,size;
-
- if (pci_enable_device(pcidev)) {
@lethean
lethean / upnp-port.js
Created May 8, 2015 02:57
Node.js UPnP Port Mapping
/* -*- mode: javascript; js-indent-level: 2; tab-width: 2; indent-tabs-mode: nil; -*-
vim: set autoindent expandtab shiftwidth=2 softtabstop=2 tabstop=2: */
'use strict';
var dgram = require('dgram'),
http = require('http'),
url = require('url'),
xml2js = require('xml2js'),
Buffer = require('buffer').Buffer;
@lethean
lethean / fa2icon.js
Created March 6, 2015 10:02
Generate Font Awesome icon name + code definition for C language
#!/usr/bin/env node
//
// Generate FontAwesome icon definitions
//
var http = require('http');
http.get('http://fontawesome.io/cheatsheet/', function (result) {
var body = '';
result.on('data', function (chunk) { body += chunk; });