Skip to content

Instantly share code, notes, and snippets.

View kanru's full-sized avatar

Kan-Ru Chen kanru

View GitHub Profile
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<selectfont>
<acceptfont>
<pattern>
<patelt name="family"><string>terminus</string></patelt>
</pattern>
</acceptfont>
<!-- we want the unicode version -->
@kanru
kanru / ipdlgraph.py
Last active August 29, 2015 13:57
Output IPDL graph using graphviz dot format
#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import ipdl
import sys
import os
def files_match(suffixes, topdir, excludes):
@kanru
kanru / csv2prop.py
Last active August 29, 2015 13:57
Convert Gaia l10n repository to a CSV file and convert back
#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import sys
import csv
def info(log):
@kanru
kanru / logserver.c
Created September 4, 2014 09:58
task tracer logserver
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
@kanru
kanru / diary-sync-ical.el
Created January 22, 2015 11:54
Sync icalendar to diary file
;;; diary-sync-ical.el --- Sync iCalendar to diary -*- lexical-binding: t; -*-
;; Copyright (C) 2015 Kan-Ru Chen (陳侃如)
;; Author: Kan-Ru Chen (陳侃如) <kanru@kanru.info>
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@kanru
kanru / yank-date-from-calendar.el
Last active August 29, 2015 14:14
yank-date-from-calendar.el
;; -*- lexical-binding: t -*-
(defun yank-date-from-calendar ()
(interactive)
(let ((date-string nil))
(set-transient-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map calendar-mode-map)
(define-key map (kbd "RET")
(lambda ()
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index daeb8f7..48e67b3 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2523,6 +2523,9 @@ int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty,
rpgrp = get_pid(real_tty->pgrp);
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
+ tty->winsize = *ws;
+ real_tty->winsize = *ws;
Index: plugins_base/Logger.py
===================================================================
--- plugins_base/Logger.py (revision 1466)
+++ plugins_base/Logger.py (working copy)
@@ -49,7 +49,7 @@
or similar'''
CREATE_USER = '''
- CREATE TABLE user
+ CREATE TABLE IF NOT EXISTS user
screen 0
{
styles
{
normal
{
font = "sans 8"
fg = "#dddddd"
bg = "#444444"
border = "#555555"
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 7501310..d529bb9 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3021,6 +3021,11 @@ static int tiocswinsz(struct tty_struct *tty, struct tty_struct *re
rpgrp = get_pid(real_tty->pgrp);
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
+ /* NOTE: This isn't really fix the problem, just lower the probability
+ * it occured */