Skip to content

Instantly share code, notes, and snippets.

View jun66j5's full-sized avatar

Jun Omae (大前 潤) jun66j5

  • OpenGroove,Inc.
  • Tokyo, Japan
View GitHub Profile
#coding: utf-8
# 238.36137 secs => 28.875 secs
require 'win32ole'
xl = WIN32OLE.new('Excel.Application')
xl.visible = true
book = xl.workbooks.add
start = Time.now
sheet = book.worksheets(1)
1.upto(10000) do |row|
cells = sheet.Range(sheet.Cells(row, 1), sheet.Cells(row, 26))
img.avatar {
max-width: 40px;
max-height: 40px;
vertical-align: bottom;
}
SELECT
CASE tt.status WHEN 'closed' THEN 5 WHEN 'new' THEN 3 ELSE 1 END AS __color__,
(CASE tt.status
WHEN 'closed' THEN 'color: #777; background: #ddd; border-color: #ccc;'
ELSE
(CASE tt.owner WHEN $USER THEN 'font-weight: bold' END)
END) AS __style__,
tt.milestone AS __group__,
t.id AS id,
'' AS 'ストーリー',
diff -r a37c038c0f07 resource/trac-plugins/hudsontracplus/HudsonTracPlus/HudsonTracPlusPlugin.py
--- a/resource/trac-plugins/hudsontracplus/HudsonTracPlus/HudsonTracPlusPlugin.py Fri Jul 22 07:48:23 2011 +0900
+++ b/resource/trac-plugins/hudsontracplus/HudsonTracPlus/HudsonTracPlusPlugin.py Wed Aug 17 13:17:44 2011 +0900
@@ -180,7 +180,7 @@
# ITimelineEventProvider methods
def get_timeline_filters(self, req):
if req.perm.has_permission('CHANGESET_VIEW'):
- yield ('build', 'Hudson Builds')
+ yield ('build', 'Hudson Builds', False)
@jun66j5
jun66j5 / pypy-genshi-0.6.diff
Created December 29, 2011 16:01
pypy-genshi-0.6.diff
--- genshi/core.py.orig 2010-04-22 21:09:52.000000000 +0900
+++ genshi/core.py 2011-12-30 00:57:18.858232418 +0900
@@ -353,6 +353,7 @@
for attr, _ in self:
if attr == name:
return True
+ return False
def __getitem__(self, i):
"""Return an item or slice of the attributes list.
@jun66j5
jun66j5 / fieldtooltip.diff
Created January 2, 2012 14:32
fieldtooltip: Parameter passing in Database API
Index: fieldtooltip/fieldtooltip.py
===================================================================
--- fieldtooltip/fieldtooltip.py (revision 11088)
+++ fieldtooltip/fieldtooltip.py (working copy)
@@ -51,10 +51,11 @@
pages = {}
cursor = db.cursor()
wiki_pages = WikiSystem(self.env).get_pages(FieldTooltip._wiki_prefix)
+ prefix_len = len(FieldTooltip._wiki_prefix)
for page in wiki_pages:
@jun66j5
jun66j5 / attachmentvalidate-r14.diff
Created January 9, 2012 12:17
Patch: uses resource_exists instead of AttachmentModule.resource_exists
Index: attachmentvalidate/console.py
===================================================================
--- attachmentvalidate/console.py (revision 14)
+++ attachmentvalidate/console.py (working copy)
@@ -1,16 +1,18 @@
- #!/usr/bin/env python
+#! /usr/bin/env python
# -*- coding: utf-8 -*-
from trac.admin.api import IAdminCommandProvider
@jun66j5
jun66j5 / gist:1625086
Created January 17, 2012 06:02
tram/standalone.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from trac.web import standalone
from tram.main import dispatch_request
# XXX Monkey patch!
standalone.dispatch_request = dispatch_request
standalone.main()
@jun66j5
jun66j5 / gist:2341182
Created April 9, 2012 03:28
Force IE8 to render in IE8 standard mode and works expanding toolbar on IE8
diff -r 625bd30aaa4c install/replace/httpd.conf.in
--- a/install/replace/httpd.conf.in Mon Mar 26 21:48:26 2012 +0900
+++ b/install/replace/httpd.conf.in Mon Apr 09 13:07:10 2012 +0900
@@ -88,7 +88,7 @@
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
-#LoadModule headers_module modules/mod_headers.so
+LoadModule headers_module modules/mod_headers.so
LoadModule imagemap_module modules/mod_imagemap.so
@jun66j5
jun66j5 / gist:2403786
Created April 17, 2012 05:54
Patch for Trac-ja 0.11.x on TracLighting 2.x
diff --git b/python-lib/trac/trac/htdocs/css/admin.css a/python-lib/trac/trac/htdocs/css/admin.css
index f686535..6bc8d0a 100644
--- b/python-lib/trac/trac/htdocs/css/admin.css
+++ a/python-lib/trac/trac/htdocs/css/admin.css
@@ -19,32 +19,30 @@
color: #000;
}
-#tabcontent { padding: 0.4em 0 0.4em 2em; margin-left: 12em; min-height: 300px; }
+#tabcontent { padding: 0.4em 2em; margin-left: 12em; min-height: 300px; }