Make tmux work with arrow keys and other things in iterm2:

set-window-option -g xterm-keys on

Before that, S-right and other keys would just get munched. Having all the S-, C- and M- mapped to escape sequences in iterm2, I can now do the following:

(define-key input-decode-map "\e[1;2A" [S-up])
(define-key input-decode-map "\e[1;2B" [S-down])
(define-key input-decode-map "\e[1;2C" [S-right])
(define-key input-decode-map "\e[1;2D" [S-left])

Posted at 10:31am and tagged with: one column,.

Notes to self:

  • Smart tool: github fork queue. Downside: doesn’t seem to show merge commits.
  • Smart tool (2): githubnotifier - https://github.com/ctshryock/GithubNotifier
  • Compiling/Configuring PHP on CPanel: /scripts/easyapache
  • Needed modules for my php app, configuration with homebrew:
brew install /usr/local/LibraryAlt/duplicates/php.rb --with-gd --with-suhosin --with-mysql --with-curl 
sudo pear channel-discover pear.symfony-project.com 
sudo pear channel-discover pear.phpunit.de 
sudo pecl install apc 
sudo pear install --alldeps phpunit/phpunit
  • Add jsdoc to Backbone.js classes so that autocompletion works in intellij: (the name of the class after @class is important, else inherited attributes won’t be autocompleted)

/**
 * @class App.Classes.Product
 * @extends Backbone.Model
 *
 */
App.Classes.Product = Backbone.Model.extend(

/** @lends App.Classes.Product */
{
  defaults: {
    categories: [],
    discounts: []
  },
});

Posted at 2:00pm and tagged with: one column,.

Using the supercool github add-on for git: https://github.com/defunkt/hub/, I wrote this little script

#!/bin/sh

hub browse -- commit/`git rev-parse $1`

to open a specific commit on the github page.

I then wrote this more elaborate awk script to blame a file, and open the originating commit at the right location on the github page. Very useful to do code review on github!

Posted at 2:20pm and tagged with: one column, git,.

I am developing a big web application in PHP, and recently switch to IntelliJ. IntelliJ offers the possibility to do remote debugging with XDebug, which was pretty easy to set up. Starting a request with ?XDEBUG_SESSION_START=intellij appended to the url starts off a remote connection from PHP to the listening IntelliJ debugger.

However, I am using a dispatcher pattern in PHP to route single requests to different OO-handlers, REST handlers as well as static handlers that serve the Javascript, CSS and images. Each of these requests would trigger a back connection to IntelliJ, which slowed down everything and proved to be pretty annoying. I want to remove certain areas of the website from the Xdebug remote debugging. This wasn’t so easy, as there is no “exclude” option either in the XDebug toggler plugins or XDebug itself.

Xdebug looks for a cookie called XDEBUG_SESSION, which is used to initiate the back connection. The value is the idekey which is used to differentiate between different listening debuggers. I wasn’t able to go around this by setting it to an empty value for the resources I wanted to exclude. However, using a non-sense key seemed to work. I thus added the following code to my application:

Posted at 3:46pm and tagged with: one column, programming,.

Get Adobe Flash player

Posted at 8:15pm and tagged with: ai-class, one column,.

Posted at 4:26pm and tagged with: one column,.

Posted at 4:25pm and tagged with: one column,.

A few settings for OSX with SSDs:

  1. disable storing RAM content to disk when going to sleep (seriously who needs that anyway?) 

    $ sudo pmset -a hibernatemode 0 

    $ sudo rm /var/vm/sleepimage

  2. Disable harddrive sleep in energy saver

  3. Disable the sudden motion sensor 

    $ sudo pmset -a sms 0

  4. Disable atime on root-fs 

    $ sudo mount -uwo noatime /

    Or put it as a launchdaemon:

    $ cat > /Library/LaunchDaemons/com.noatime.root.plist <
    
    
        
            Label
            com.noatime.root
            ProgramArguments
            
                mount
                -uwo
                noatime
                /
            
            RunAtLoad
            
        
    
    EOF
    
    

Posted at 11:37am and tagged with: one column,.

Posted at 8:27pm and tagged with: one column, avr,.