Skip to content

Instantly share code, notes, and snippets.

@superdaigo
superdaigo / init.el
Created October 7, 2015 03:49
Simple init.el
;; Encoding
(setq default-file-name-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
(setq default-process-coding-system '(utf-8 . utf-8))
;; Misc
(setq inhibit-startup-message t) ;; Hide Startup Cow
(setq visible-bell t) ;; Visible bell
(menu-bar-mode -1) ;; Menu bar (1: Enable, -1: Disable)
(blink-cursor-mode 0) ;; Blink Cursor (0: off, 1: blink)
@superdaigo
superdaigo / gunicorn_error.log
Created August 15, 2012 13:32
gunicorn の起動エラー
Traceback (most recent call last):
File "/home/oreore/app/env/bin/gunicorn_django", line 8, in <module>
load_entry_point('gunicorn==0.14.6', 'console_scripts', 'gunicorn_django')()
File "/home/oreore/app/env/lib/python2.6/site-packages/gunicorn/app/djangoapp.py", line 132, in run
DjangoApplication("%prog [OPTIONS] [SETTINGS_PATH]").run()
File "/home/oreore/app/env/lib/python2.6/site-packages/gunicorn/app/base.py", line 124, in run
Arbiter(self).run()
File "/home/oreore/app/env/lib/python2.6/site-packages/gunicorn/arbiter.py", line 72, in __init__
cwd = os.getcwd()
OSError: [Errno 2] No such file or directory
@superdaigo
superdaigo / app.log
Created August 16, 2012 10:30
gunicorn_django syncworker socket error
Traceback (most recent call last):
File "/home/oreore/app/env/lib/python2.6/site-packages/gunicorn/workers/sync.py", line 33, in run
client, addr = self.socket.accept()
File "/usr/lib64/python2.6/socket.py", line 197, in accept
sock, addr = self._sock.accept()
error: [Errno 11] Resource temporarily unavailable
@superdaigo
superdaigo / init.el
Created October 5, 2012 22:55
Klipper copy & paste for emacs terminal (KDE)
;; linux
(when (eq 'gnu/linux system-type)
;; terminal
(unless window-system
;; I don't know how to detect the system was KDE or not. :(
(defun copy-from-kde()
(let ((output (shell-command-to-string "qdbus org.kde.klipper /klipper getClipboardContents")))
(unless (string= (car kill-ring) output)
output )))
(defun paste-to-kde (text &optional push)
#!/bin/bash
find . -name ".git" -type d -prune -print -execdir git pull \;
@superdaigo
superdaigo / insert-date.el
Last active December 14, 2015 14:59
The sample function to insert current date in emacs. The format is "yyyy-mm-dd (aaa)" in this snippet.
;; insert-date
(defun insert-date ()
"Insert current date yyyy-mm-dd (aaa)"
(interactive)
;; Print weekday in English
(setq tmp-locale woman-locale)
(set-locale-environment "en_US.UTF-8")
(insert (format-time-string "%Y-%m-%d (%a)"))
(set-locale-environment tmp-locale)
)
In [1]: for i in range(1,100):
...: if pow(i, 17) % 3569 == 915:
...: print i
...:
2012
5581
9150
@superdaigo
superdaigo / check_pip_download_time.sh
Created August 15, 2013 10:21
Check pip download time (sec) for each pypi mirror servers.
#!/bin/bash
# System Requirements
# pip ... python package install command
# requirements.txt ... package list to install via pip
TMP_DIR="${HOME}/tmp"
REQUIREMENTS_TXT="requirements.txt"
@superdaigo
superdaigo / radiko_player_air.log
Created November 19, 2013 22:47
Log of radiko_player_air (Version 3.1.0) Display was slept around 7:10. Hope fixed latest version.
2013/11/20 6:40:04.725 radiko_player_air[58661] CoreText performance note: Client called CTFontCreateWithName() using name "Times Roman" and got font with PostScript name "Times-Roman". For best performance, only use PostScript names when calling this API.
2013/11/20 6:40:04.725 radiko_player_air[58661] CoreText performance note: Set a breakpoint on CTFontLogSuboptimalRequest to debug.
2013/11/20 6:40:08.184 radiko_player_air[58661] The function `CGFontSetShouldUseMulticache' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance.
2013/11/20 7:10:14.354 radiko_player_air[58661] HIToolbox: received notification of WindowServer event port death.
2013/11/20 7:10:14.357 radiko_player_air[58661] port matched the WindowServer port created in BindCGSToRunLoop
2013/11/20 7:10:14.559 radiko_player_air[58661] CGError CGSGetDisplaySystemState(uint64_t, CGSDis
@superdaigo
superdaigo / gist:8131115
Last active January 1, 2016 10:19
Redmine 2.3-stable: Append project identifier into mail header 'List-ID'
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index c12195a..9819776 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -388,6 +388,31 @@ class Mailer < ActionMailer::Base
'From' => Setting.mail_from,
'List-Id' => "<#{Setting.mail_from.to_s.gsub('@', '.')}>"
+ # set List-ID
+ if @issue