How to replace new line characters \r\n with a newline in VIM

Plain Text posted 4 days ago by christian

To get the ^M character, type CTRL+V and press enter:

   1  :%s/\\r\\n/^M/g

Tagged vim, newline, search, replace

Fix for "Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain"

Plain Text posted 3 months ago by christian

I got this error the other day:

   1  Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain

The fix for me was this:

  • Login to iPhone Developer Program
  • Click on Certificates
  • Under Current Development Certificates click on the button to download your certificate. It gets saved as developer_identity.cer.
  • Open the Keychain tool
  • Make sure the “login” keychain is selected in the left pane.
  • Make sure that “login” is the default keychain (right-click on the login item to do this)
  • Drag the developer_identity.cer file to the login keychain’s list of certificates.
  • Build your app
Tagged iphone, xcode, titanium, certificate

How to remove trailing slash with nginx rewrites

Plain Text posted 4 months ago by christian

   1  # Remove trailing slash by doing a 301 redirect
   2  rewrite ^/(.*)/$ /$1 permanent;

Tagged nginx, rewrite

How to implement copy-to-clipboard functionality that works with Flash 10

Plain Text posted 5 months ago by christian

Use mojombos’ Clippy which can be downloaded from GitHub.

How to create a custom button

  • First create your button and save it as a PNG file.
  • Change library.xml to use your button.
  • Customize the code behind the button by modifying clippy.hx. You can, for example, remove the “Copy to clipboard” label.
  • Set the width and height of the button. You have to set it in almost all files (compile.hxml, library.xml, etc).
  • Compile the SWF file:

   1  swfmill simple library.xml library.swf && haxe compile.hxml

Alternatives

There are no good alternatives that I know of. I tried ZeroClipboard and other solutions, but they were full of bugs and not customizable.

Tagged copy, clipboard, copy-to-clipboard, clippy, flash 10, flash

How to share the clipboard between MacVim/Gvim and OSX/Windows

Plain Text posted 7 months ago by christian

Add this to .vimrc:

   1  set clipboard=unnamed

Now you can copy and paste without extra bullshit ninja keyboard shortcuts.

If you’re still having problems copying between the terminal/MacVim and OSX you need to check if vim was compiled with clipboard support:

   1  vim --version

You should see +xterm_clipboard and +clipboard in the output. If you see -xterm_clipboard and/or -clipboard you’ll have to compile vim from source.

Tagged vimrc, vim, copy, clipboard, xterm_clipboard