Skip to content

Instantly share code, notes, and snippets.

@bamanzi
bamanzi / gist:1220603188ad99fe8b3b
Created May 1, 2014 08:13
redmine 2.4-2.5 noteable changes
  • Patch #13900: Update URL when changing tab
  • Feature #14614: View hooks for user preferences
  • Feature #13945: Disable autofetching of repository changesets if projects are closed
  • Feature #13746: Highlighting of source link target line
  • Feature #8253: Update CodeRay to 1.1 final
  • Defect #15058: Project authorization EnabledModule N+1 queries
  • Defect #16032: Repository.fetch_changesets > app/models/repository/git.rb:137:in `[]=’: string not matched (IndexError)
  • Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass “Repository:Git”
  • Defect #15781: Customfields have a noticabl
@bamanzi
bamanzi / Tabundle.createGroupListHtml.js
Created February 17, 2012 08:17
[firefox] hacking tabundle extension: only list tabs in current group (panorama)
//extensions/tabundle@relucks.org/chrome/content/tabundle.js
Tabundle.createGroupListHtml = function() {
var height = window.innerHeight;
var currentGroup = TabView._window.GroupItems.getActiveGroupItem();
var list = Array.map(currentGroup._children, function(tabitem) {
var w = gBrowser.getBrowserForTab(tabitem.tab).contentWindow
var c = Tabundle.capture(w, {x: 0, y:0}, {h: height, w: w.innerWidth}, 0.3)
return [w.document.title, w.location.href, c]
})
var date = Tabundle.dateString();
@bamanzi
bamanzi / auto-complete-ispell.el
Created February 17, 2012 08:33
[emacs] auto-complete + ispell
(defun ac-ispell-get-word ()
(format "\\(%s\\)" (car (ispell-get-word nil "\\*"))))
(defun ac-ispell-get-candidates (prefix)
(let ((word prefix)
(interior-frag nil))
(lookup-words (concat (and interior-frag "*") word
(if (or interior-frag (null ispell-look-p))
"*"))
ispell-complete-word-dict)))
@bamanzi
bamanzi / keysnail-goo.gl.js
Created February 20, 2012 03:49
[keysnail] use goo.gl to shorten current URL
ext.add("goo.gl", function () {
let endpoint = "https://www.googleapis.com/urlshortener/v1/url";
let params = { "longUrl": window._content.document.location.href };
let result = util.httpPostJSON(endpoint, params, function (xhr) {
if (xhr.status == 200) {
var ret = JSON.parse(xhr.responseText);
command.setClipboardText(ret.id);
display.echoStatusBar("Short URL copied into clipboard: " + ret.id, 3000);
} else {
display.echoStatusBar("goo.gl service failed: " + xhr.statusText, 3000);
@bamanzi
bamanzi / ks-open-ext-dialog.js
Created March 7, 2012 09:57
[keysnail] open extensions dialog
ext.add("open-extension-dialog", function(ev, arg) {
var wm = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator);
OpenAddonsMgr = function(type, typeUrl) {
var extensionManager = wm.getMostRecentWindow("Extension:Manager");
if (extensionManager) {
extensionManager.focus();
extensionManager.showView(type);
} else {
var addonManager = wm.getMostRecentWindow("Addons:Manager");
@bamanzi
bamanzi / anything-goto-symbol
Created March 19, 2012 04:11
[emacs] Best(?) way to go to a function/variable's declaration (within buffer)
(defun anything-goto-symbol ()
"Show anything list, using current symbol as input to narrow the choices."
(interactive)
(anything
:prompt "Go to:"
:candidate-number-limit 10
:input (thing-at-point 'symbol)
:sources
'( anything-c-source-imenu
anything-c-source-browse-code
@bamanzi
bamanzi / gist:2250340
Created March 30, 2012 09:33
[emacs] Use frame to group buffers (similar to perspective feature)
;; use `frame-bufs.el' to mimic perspective feature
(idle-require 'frame-bufs)
(defun frame-bufs-switch-buffer ()
"Switch buffer, within buffers associated with current frame (`frame-bufs-buffer-list')"
(interactive)
(if (and (fboundp 'frame-bufs-mode)
frame-bufs-mode)
(let* ( (buffers (mapcar 'buffer-name (frame-bufs-buffer-list (selected-frame))))
@bamanzi
bamanzi / keysnail-sidebar.js
Created April 22, 2012 02:04
[keysnail] Load current URL in sidebar
ext.add("view-in-sidebar", function() {
toggleSidebar('', false);
var sidebarcmd = document.getElementById('viewURISidebar');
//print(sidebarcmd.getAttribute("sidebarurl"))
//print(sidebarcmd.getAttribute("checked"))
sidebarcmd.removeAttribute("checked");
sidebarcmd.setAttribute("sidebarurl", content.location.href);
sidebarcmd.setAttribute("sidebartitle", content.document.title);
@bamanzi
bamanzi / jasspa.emf
Created April 22, 2012 01:59
my jasspa.emf
global-bind-key beginning-of-line "home"
global-bind-key end-of-line "end"
;!force exec-file "msshift"
set-variable %cygwin-path "e:/cygwin2"
;!force exec-file "win32"
set-variable $INFOPATH &cat %cygwin-path "/usr/share/info"
;; Emacs-like imenu
@bamanzi
bamanzi / tabundle-group.js
Created April 22, 2012 02:02
[firefox] let `tabbundle' only snapshot tabs in current group
// let `tabbundle' only snapshot tabs in current group
// put these code into:
// extensions\tabundle@relucks.org\chrome\content\tabundle.js
Tabundle.bundle = function() {
Tabundle.createIndexHtml()
//var path = Tabundle.createListHtml()
var path = Tabundle.createGroupListHtml();
if (path) {