Posterous theme by Cory Watilo

Reading a text file using iOS

I am writing an iOS app where I wanted to read a .txt file and load it into a NSString. 

After googling and reading tons of complicated solutions using NSFileManager I came up with a simple solution.

First, you need to add your .txt file  into your project just by dragging it, your file will be added in your project Bundle Resources Items. 

To get the file path use 

 

[[NSBundle mainBundle] pathForResource:@"yourFile" ofType:@"txt"];  

To load the content file into a NSString use

 

NSString stringWithContentsOfFile

 

 

Here is the code

 

A CSS3 Shiny Button

Screen_shot_2010-08-18_at_11

 

    <style>
    .button1{
        width: 150px;
        height: 40px;
        padding-top:1px;
        -moz-border-radius: 5px;  
        -khtml-border-radius: 5px; 
        -webkit-border-radius: 5px; 
        border-radius: 5px; 
        background: -moz-linear-gradient(top, #FFF, #000, #000000);
        background: -webkit-gradient(linear, 0 0, 0 100%, from(#b4b3b4), to(#bcbcbc));
        border: 1px solid #909090;
    }

    .button-shine1{
        width:98%;
        height:50%;
        margin:0px auto 30px auto;
        background-color:rgba(255,255,255,0.25);
        -moz-border-radius: 5px;  
        -khtml-border-radius: 5px; 
        -webkit-border-radius: 5px; 
        border-radius: 5px;

    }

    .button1-text{
        width:100%;
        text-align:center;
        font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
        font-size:13px;
        font-weight:bold;
        color:#707070;
        text-shadow: 1px 1px 2px #FFF;
        letter-spacing: 1px;    
        position:relative;
        margin-top:-40px;
    } 
    </style>

   <div  class="button1">
        <div class="button-shine1"></div>
        <div class="button1-text">Continue</div>
    </div>

 

Linode Shell Backspace

So I was setting up a new Ubuntu Image on Linode, but when trying to use the shell I couldn't use backspace, using iTerm on MacOSX. 

The solution: Bookmarks - Manage Profiles -> xterm (OSX) -> add a key combination (delete) -> Send HEX code ff08 and voilá! 

I you are using the default terminal, just go to Preferences -> Advanced -> Delete sends Ctrl-H

now you can use your delete key and it will work fine.