Ayush's Blog

  • Top Level Functions In Ruby

    While working on Matasano crypto challenges, I reached a stage where I could reuse the functions I had written in previous exercises. So let’s suppose I had a function foo in 1.rb 1 2 3 def foo "foo" end I need the function foo in my second script named 2.rb...

  • Non Breaking Space For Html

      is used to create a non breaking (doesn’t insert a new line) space character in HTML.

  • Creating Footer For Jekyll

    I am updating this jekyll blog to a new theme. For the new theme, I had to update the footer to include links to my mail, github and twitter. What I really wanted was to just show the relevant icons and then link them to my accounts. Github and Twitter’s...

  • Bash Too Many Arguments

    if test ! -f $path The above script would create bash warnings for you like test: too many arguments The problem here is that the path contains spaces in it, and thus the test gets “more than one arguments”. The solution for the above problem is a pretty simple one,...

  • Notes From Wwdc Extensions Talk

    separate target Needs different entitlement isolated address space executes independantly Frameworks - encrypted Min deployment target to be ios 8 :( App links to framework - change all extensions in a framework, not changes NS_EXTENSION_UNAVAILABLE_IOS Sharing data - separate containers shared container Extension and App can be running simultaenously. Synchronize...

  • Helper Script To Create Post Template For Jekyll Blogs

    It has been tedious to name a Jekyll post file with the weird format. So, I created a python script to solve this. :) The gist tries to solve not only the naming problem, but also adds helpers to create the required front-matter. Also, I have added a small wrapper...

  • Boolean In Objective C

    This post is inspired from the eye-opener article -> bignerdranch. I always had this question, “Why does Objective-C need a BOOL when C gives it a free bool, which effectively works the same?”. Well, I couldn’t have been more wrong. BOOL and bool are entirely different beasts. BOOL is a...

  • Setting background color of UITableViewCell in UINib doesn't work for iPad

    Using a UINib to create a UITableViewCell was one of the best conveniences I had in long time. The problem started when the backgroundColor set in the UINib didn’t take effect for iPad builds. I had to set the backgroundColor explicitly in code for each cell. Here is the relevant...