Skip to content

Instantly share code, notes, and snippets.

@waltarix
waltarix / tmux-do-not-combine-utf8.patch
Last active May 29, 2022 09:58
tmux: Fix a problems with displaying Ambiguous-width, Japanese Dakuten and Handakuten signs.
diff --git a/screen-write.c b/screen-write.c
index 15f8d07..8a175a6 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1334,6 +1334,7 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
ctx->cells++;
/* If the width is zero, combine onto the previous character. */
+ /*
if (width == 0) {
@jeremi
jeremi / restore_namespace_after_function.py
Created December 12, 2010 09:19
This decorator restore the original namespace after the function has been executed in appengine.
def restore_namespace_after(func):
"""Decorator that ensures that restore the original namespace after the function has
been executed in appengine."""
@functools.wraps(func)
def decorated_func(*args, **kwargs):
namespace = namespace_manager.get_namespace()
res = func(*args, **kwargs)
namespace_manager.set_namespace(namespace)
return res
return decorated_func
from dulwich import client
import paramiko
class ParamikoWrapper(object):
def __init__(self, host, command, username, port):
self.client = paramiko.SSHClient()
self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
self.client.connect(host, username=username)
self.streams = self.client.exec_command(command[0])
self.write = self.streams[0].writelines
self.read = self.streams[1].readline
@mpen
mpen / ScalaSwingFile.scala
Created October 27, 2009 01:59
ScalaでSwing ファイルを開く・保存
// ScalaでSwing ファイルを開く・保存
import scala.swing._
import scala.swing.event.ButtonClicked
import java.io.{ File, IOException }
import java.awt.Font
import javax.swing.{ UIManager, SwingUtilities }
import javax.swing.filechooser.FileNameExtensionFilter
import org.apache.commons.lang.SystemUtils
import org.apache.commons.io.FileUtils