Secret Ham

With a little side of applesauce...

Tuesday, October 1, 2013

Click doesn't give element focus in Chrome?

Click doesn't give element focus in #chrome? Seems to be this issue: https://bugs.webkit.org/show_bug.cgi?id=22261 . Here is a fix:
// fix webkit bug #22261, which doesn't give   
// radio buttons focus when clicked with mouse
$('input').click(function() {
   $(this).focus();
});

Thursday, August 15, 2013

Gmail: How to revert to old Gmail mailbox

If you find the tabbed Gmail interface cumbersome, you can revert to the old-school no-tab interface by clicking on:

  Settings -> Configure inbox

And, unchecking all of the boxes, except for Primary.

Monday, May 20, 2013

dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid

I just upgraded to Mountain Lion on Friday, and have been plagued by this error:
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
The best fix that I have seen is:
sudo () { ( unset LD_LIBRARY_PATH DYLD_LIBRARY_PATH; exec command sudo $* ) }
Short and elegant. Stolen from here.

Monday, January 28, 2013

EMACS 24 and Windows 7 - current-kill: Symbol's function definition is void: x-cut-buffer-or-selection-value

If you are getting the following error when setting up EMACS 24 on Windows 7:

current-kill: Symbol's function definition is void: x-cut-buffer-or-selection-value

Open your .emacs and change:
'x-cut-buffer-or-selection-value)

to:
(setq interprogram-paste-function 'x-selection-value)

I found the answer in this posting:
http://lists.gnu.org/archive/html/emacs-devel/2010-09/msg00638.html

Wednesday, January 2, 2013

jwerty keymapping

Just placing these here, as it is easier for me to access than the github source... I needed arrow keys, and if you look in the following code, you see a long text version for these, (ie. arrow-left, arrow-right).
  // Generate key mappings for common keys that are not printable.
    var _keys = {
        
        // MOD aka toggleable keys
        mods: {
            // Shift key, ⇧
            '⇧': 16, shift: 16,
            // CTRL key, on Mac: ⌃
            '⌃': 17, ctrl: 17,
            // ALT key, on Mac: ⌥ (Alt)
            '⌥': 18, alt: 18, option: 18,
            // META, on Mac: ⌘ (CMD), on Windows (Win), on Linux (Super)
            '⌘': 91, meta: 91, cmd: 91, 'super': 91, win: 91
        },
        
        // Normal keys
        keys: {
            // Backspace key, on Mac: ⌫ (Backspace)
            '⌫': 8, backspace: 8,
            // Tab Key, on Mac: ⇥ (Tab), on Windows ⇥⇥
            '⇥': 9, '⇆': 9, tab: 9,
            // Return key, ↩
            '↩': 13, 'return': 13, enter: 13, '⌅': 13,
            // Pause/Break key
            'pause': 19, 'pause-break': 19,
            // Caps Lock key, ⇪
            '⇪': 20, caps: 20, 'caps-lock': 20,
            // Escape key, on Mac: ⎋, on Windows: Esc
            '⎋': 27, escape: 27, esc: 27,
            // Space key
            space: 32,
            // Page-Up key, or pgup, on Mac: ↖
            '↖': 33, pgup: 33, 'page-up': 33,
            // Page-Down key, or pgdown, on Mac: ↘
            '↘': 34, pgdown: 34, 'page-down': 34,
            // END key, on Mac: ⇟
            '⇟': 35, end: 35,
            // HOME key, on Mac: ⇞
            '⇞': 36, home: 36,
            // Insert key, or ins
            ins: 45, insert: 45,
            // Delete key, on Mac: ⌫ (Delete)
            del: 46, 'delete': 46,
            
            // Left Arrow Key, or ←
            '←': 37, left: 37, 'arrow-left': 37,
            // Up Arrow Key, or ↑
            '↑': 38, up: 38, 'arrow-up': 38,
            // Right Arrow Key, or →
            '→': 39, right: 39, 'arrow-right': 39,
            // Up Arrow Key, or ↓
            '↓': 40, down: 40, 'arrow-down': 40,
            
            // odities, printing characters that come out wrong:
            // Num-Multiply, or *
            '*': 106, star: 106, asterisk: 106, multiply: 106,
            // Num-Plus or +
            '+': 107, 'plus': 107,
            // Num-Subtract, or -
            '-': 109, subtract: 109,
            // Semicolon
            ';': 186, semicolon:186,
            // = or equals
            '=': 187, 'equals': 187,
            // Comma, or ,
            ',': 188, comma: 188,
            //'-': 189, //???
            // Period, or ., or full-stop
            '.': 190, period: 190, 'full-stop': 190,
            // Slash, or /, or forward-slash
            '/': 191, slash: 191, 'forward-slash': 191,
            // Tick, or `, or back-quote 
            '`': 192, tick: 192, 'back-quote': 192,
            // Open bracket, or [
            '[': 219, 'open-bracket': 219,
            // Back slash, or \
            '\\': 220, 'back-slash': 220,
            // Close backet, or ]
            ']': 221, 'close-bracket': 221,
            // Apostraphe, or Quote, or '
            '\'': 222, quote: 222, apostraphe: 222
        }
        
    };

Tuesday, December 18, 2012

Add custom thumbnail instead of pagepeeker preview

(copied from my feature request on the timeline.js Google Group)

Hi all,

I am implementing timeline.js with a class interactive here at MY, and found that pagepeeker couldn't access our protected videos, (through the library). I created a work-around that allows you to include a custom clickable thumbnail in the data.json.

synopsis: checks for 'thumbnail' key in asset struct. If asset.thumbnail != null && asset.thumbnail != ''; then show thumbnail. Else, show pagepeeker thumb.

Here is the updated json:

    "asset":
    {
     "media":"http://ezproxy.library.my.edu/login?url=http://myhostedfilms.com",
     "credit":"",
     "caption":"",
     "thumbnail":""
    }


Here is the patch:

--- timeline.js.orig 2012-12-18 10:32:32.000000000 -0800
+++ timeline.js 2012-12-18 11:10:53.000000000 -0800
@@ -4050,17 +4050,23 @@
    
    create: function(m) {
     trace("WEB THUMB CREATE");
-    //http://pagepeeker.com/t/{size}/{url}
+                            if (m.thumbnail != null && m.thumbnail != "") {
+
+                                thumb_url=m.thumbnail;
+                                VMM.attachElement("#" + m.uid, "");
+    VMM.attachElement("#" + m.uid + "_thumb", "");
+                            } else {
+                                //http://pagepeeker.com/t/{size}/{url}
     //http://api.snapito.com/free/lc?url=
     
     var thumb_url = "http://pagepeeker.com/t/";
-     url   = m.id.replace("http://", "");//.split("/")[0];
-     
+    url   = m.id.replace("http://", "");//.split("/")[0];
     // Main Image
     VMM.attachElement("#" + m.uid, "");
     
     // Thumb
     VMM.attachElement("#" + m.uid + "_thumb", "");
+                            }
    },
    
    pushQue: function() {
@@ -4190,10 +4196,11 @@
    
    if (data.media != null && data.media != "") {
     var mediaElem = "", captionElem = "", creditElem = "", _id = "", isTextMedia = false, m;
-    
+
     m = VMM.MediaType(data.media); //returns an object with .type and .id
     m.uid = uid;
     _valid = true;
+                            
     
    // CREDIT
     if (data.credit != null && data.credit != "") {
@@ -4203,6 +4210,10 @@
     if (data.caption != null && data.caption != "") {
      captionElem   = "
" + VMM.Util.linkify_with_twitter(data.caption, "_blank") + "
";
     }
+   // CUSTOM THUMBNAIL
+    if (data.thumbnail != null && data.thumbnail != "") {
+                                    m.thumbnail = data.thumbnail;
+    }
    // IMAGE
     if (m.type    == "image") {
      if (m.id.match("https://")) {


Thanks for the great product!

speeves