Posts tagged programming

Moving from Sublime Text 2 to Sublime Text 3

Screen Shot 2013-11-15 at 16.46.02As Sublime Text 3 is around in public beta for quite some time, i thought i upgrade from my 2.x version to the new and – as it’s written on their homepage – faster version 3.

Ross Lawley has a perfect guide how to upgrade painlessly:
http://rosslawley.co.uk/posts/switching-to-sublimetext-3/

And thanks for the hint to check the compatibility of the plugins first on this great page:
http://www.caniswitchtosublimetext3.com/

 

Steps how i upgraded:

  • download Sublime Text 3
  • install package manager in Sublime Text 3 by showing the console (view -> show console) and entering this text:
import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
  • using the package manager install all your (green) plugins you used on Sublime Text 2
  • copy and paste user settings (Preferences -> Settings -> User)
  • go to terminal and copy TM Themes, other settings and relink the commandline “subl” to the new version (i have ~/bin in my path):
$ cp ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/*.tmTheme* ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/
$ rm ~/bin/subl
$ ln -s /Applications/Sublime\ Text\ 3.app/Contents/SharedSupport/bin/subl ~/bin/subl

Enjoy!

Use multiple email addresses (SSH keys) with GitHub

There is a good tutorial on Gist that shows all the required tasks:

https://gist.github.com/2351996

This post is to remind me how to do it 😉

Von TextMate auf VIM umsteigenSwitching to Vim from TextMate

Basierend auf Daniel Fischer’s Artikel habe ich hier dokumentiert wie ich von TextMate nach Jahren auf MacVIM umgestiegen bin. Das hat den Vorteil für mich, dass ich nur noch einen Texteditor verwende, egal ob ich auf Linux oder auf Mac OS X arbeite.

MacVim installieren

  • MacVim von https://github.com/b4winckler/macvim/ (latest snapshot) runterladen
  • MacVim.app in /Applications kopieren
  • mvim in den Pfad kopieren (zu finden im entpackten MacVim-snapshot-xx Ordner mittels Terminal):
$ sudo mv mvim /usr/local/bin/

Install git

Install Carlhuda’s vim Distribution

$ for i in ~/.vim ~/.vimrc ~/.gvimrc; do [ -e $i ] && mv $i $i.old; done
$ git clone git://github.com/carlhuda/janus.git ~/.vim
$ cd ~/.vim
$ rake

macVim tunen

Syntax Highlight für Actionscript

" overwrite actionscript .as file detection
au BufRead,BufNewFile *.as set ft=actionscript

Farbschema auswählen

im gvimrc bzw vimrc nach einer Zeile die “color molokai” enthält suchen und mit folgender Zeile ersetzen:

color candycode

Taglists (zeigt Variablen, Funktionen in einem Fenster an)

Leider ist die ctags Version die in Mac OS X installiert ist zu alt und wir müssen eine aktuelle Version selbst runterladen und installieren:

$ curl -O http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz
$ tar xzvf ctags-5.8.tar.gz
$ cd ctags-5.8
$ ./configure
$ make
$ make install

Nun das Tag List Vim Plugin runterladen http://www.vim.org/scripts/script.php?script_id=273 und im gvimrc bzw. vimrc folgende Zeilen hinzufügen:

" Select the exuberant ctags (had to be downloaded and installed!)
let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'
" configure Tag List
let Tlist_Show_One_File = 1
let Tlist_Use_Right_Window = 1
let Tlist_WinWidth = 40

Das Plugin lässt sich über :TlistToggle im VIM aktivieren.

Links

Based on Daniel Fischer’s article i document how i switched to Vim from TextMate after using TextMate for several years.

Install MacVim

  • download from https://github.com/b4winckler/macvim/ (use latest snapshot)
  • copy MacVim.app to your /Applications directory
  • copy mvim into your path, change into the unzipped downloaded MacVim-snapshot-xx folder in your Terminal and enter:
$ sudo mv mvim /usr/local/bin/

Install git

Install Carlhuda’s vim Distribution

$ for i in ~/.vim ~/.vimrc ~/.gvimrc; do [ -e $i ] && mv $i $i.old; done
$ git clone git://github.com/carlhuda/janus.git ~/.vim
$ cd ~/.vim
$ rake

Pimp macVim

syntax highlight file for actionscript

" overwrite actionscript .as file detection
au BufRead,BufNewFile *.as set ft=actionscript

choose a default color theme

search for a line containing color molokai and replace it with

color candycode

Taglists (displays variables, functions, …)

Unfortunately the ctags needed for the TagList vim plugin which comes preinstalled with Mac OS X doesn’t work because it’s too old. Therefore we need to build it ourselves:

$ curl -O http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz
$ tar xzvf ctags-5.8.tar.gz
$ cd ctags-5.8
$ ./configure
$ make
$ make install

Now download and install the Tag List vim plugin from here: http://www.vim.org/scripts/script.php?script_id=273

Edit your .vimrc file:

" Select the exuberant ctags (had to be downloaded and installed!)
let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'
" configure Tag List
let Tlist_Show_One_File = 1
let Tlist_Use_Right_Window = 1
let Tlist_WinWidth = 40

use the tag list plugin by typing :TlistToggle in your VIM

Links

Flash on the Beach 2009 – Brighton, UK

Brighton sunny day - 8 Fotogalerie mit Impressionen von der Flash on the Beach Konferenz in Brighton

Brighton sunny day - 8Some pictures from Flash on the Beach, Brighton
Read More »

Error compiling for iPhone SDK 2.2

After upgrading to iPhone SDK 2.2 and updating my iPod Touch’s Firmware to 2.2 (hell yeah, i love the option to disable automatic spellchecking!!!), i got an error building my iPhone Project:

ld: library not found for -lcrt1.10.5.o

The solution:

The error indicates some error when crosscompiling similar to crosscompiling from OS X 10.5?to Mac OS X 10.4?.

I checked the settings for my project and found that i had still set “Device – iPhone OS 2.1” as my Base SDK. After changing the Base SDK to the most recent (and installed) version of the SDK it worked:

iPhone SDK 2.2 Base SDK setting

Compile Python 2.4.4 on Mac OS X 10.5 (Leopard)

Recently i upgraded my OS to Leopard and had to recompile python 2.4.4 for my Zope 3 buildout setup (i need a clean python for that). The problem was, that python 2.4.4 won’t build on leopard, Jodok Batlogg from Lovely Systems had the same problem and instantly found the solution. As he hasn’t posted it to his blog, i will post it here:

./configure

add this line to pyconfig.h in the same directory:

#define SETPGRP_HAVE_ARG 1
./make
./make install

that’s it!

Technorati Tags: , ,

Anarchy Media Player

As you might already know, Anarchy Media Player is a way cool javascript-based player solution for playback of media files like .mp3, quicktime movies, flash movies and so on. The very cool thing about that is, all you have to do is to include the anarchy player javascript file into your html document and each and every link to a file ending with .mp3, .mov, .wmv, .flv, … will be magically converted into a media player (thanks to the HTML DOM and javascript 😉 ).

I use the 1.6.5 version and found that when you add a class with “amplink” to your link, the media player will ignore this link! This comes handy if you want to explicitly put a link to a movie file for which you don’t want the mediaplayer magic to happen. Imagine you have a link to a flash video and two links for quicktime movies in high and low quality for download. The link to the .flv should be converted into a media player, the two quicktime links should be left intact – just put a “amplink” class on the two quicktime links and you’re set!

get kaa.metadata (mmpython) running on OS X

Dependencies

get and install libxml2

download sources for libxml2 and libxslt from http://xmlsoft.org/downloads.html
build and install

./configure --with-python=/<pathtoyourpythonbinary>/python
make
sudo make install

Install kaa

first get kaa from svn:

svn co svn://svn.freevo.org/kaa/trunk kaa

i had to disable the building of the shared memory module on OS X because it wouldn’t build. As it seems kaa.metadata works without the shared memory module, but maybe someone knows how to get this built on OS X with the shm module.
go into kaa/base and edit setup.py by changing (line 36) this

extensions.append( Extension('shmmodule', ['src/extensions/shmmodule.c']) )

to this

#extensions.append( Extension('shmmodule', ['src/extensions/shmmodule.c']) )

until now the support for cdrom drives only works on Linux, so i disabled it on OS X.
now go to kaa/metadata and edit setup.py:
change this

ext_modules = [ cdrom, ifoparser ]

to

#ext_modules = [ cdrom, ifoparser ]
ext_modules = [ ifoparser ]

and change this

ext_modules = [ cdrom ]

to

#ext_modules = [ cdrom ]
ext_modules = [ ]

now go back to kaa/base and install the kaa.base package:

sudo python setup.py install

now go to kaa/metadata and install the kaa.metadata package:

sudo python setup.py install

you may use a different python instance, like /opt/python24/bin/python or something else if you don’t wanna install kaa into the default python on OS X.

kupu resize images

I always had the problem, that i could resize (drag with my mouse) images inside kupu, but when i save the document the image has its original size 🙁

Today i found the solution to this problem here

To enable kupu to keep the resize information upon save you have to add width and height to the style whitelist in the kupu preferences in your site preferences. Your styles whitelist should look like this:

text-align
list-style-type
float
width
height

that did the trick and now resizing images is working 🙂

Sprache ändern

Categories

Archives