How to install Ruby on Rails on macOS Sierra 10.12

  1. Install Homebrew. Homebrew simplifies the installation of software on Apple’s macOS operating system. Open Terminal and run the following command:
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install Xcode. Xcode is a software package to help you develop iOS and OS X applications. You don’t need the full Xcode package to get the Command Line Tools. Check if the full Xcode package is already installed:
    xcode-select -p

    if you see:

    /Applications/Xcode.app/Contents/Developer

    it means the full package is already installed. If you don’t have it, type this command to install:

    xcode-select --install

    then will appear this :

    xcode-select: note: install requested for command line developer tools.

    An update popup window will appear to install the command line developer tools. You can choose to confirm by clicking “install”. Wait for the Command Line Tools package download to complete.

     

  3. Install Ruby. Run the following commands in your Terminal:
    brew install rbenv ruby-build
    rbenv install 2.4.1
    rbenv global 2.4.1
    ruby -v

    #ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin15]

     

  4. Install Rails
    gem install rails -v 5.0.1

    installingrailinstallingrail2

  5. Execute the Rails with this command:
    rbenv rehash
  6. Verify Rails version:
    rails -v

    #Rails 5.0.1

  7. Setting up a database using mySQL
    brew install mysql

    installingmysql
    To have launchd start mysql now and restart at login:
    brew services start mysql
    Or, if you don’t want/need a background service you can just run:
    mysql.server start

  8. Final steps to create your first Rails application:
    rails new myfirstapp
    rails new myfirstapp -d mysql
    #move to the folder directory
    cd myfirstapp
    #Create the database
    rake db:create
    rails server
  9. Open your browser and type http://localhost:3000 to view your website.localhost.png

How to set up micro:bit and start your adventure

What is micro:bit?

micro:bit is a pocket-sized codeable computer with motion detection, a built-in compass and Bluetooth technology.

There are many micro:bit kit available out there. One of the samples is Tea Brewer Kit.

Please refer here for the instructions.

If you’re just getting started with the Micro Bit, we recommend you check out a few of the tutorials, uploaded by the BBC and its partners to the Micro Bit website.

OK. Let’s Get Started!

Connect the micro:bit to the battery holder and follow the instructions on the LED display.

  1. The LED display will light up, with the word “HELLO”
  2. The arrow signs pointing to the left button, and you’ll be asked to press the A button on the left, and next it will point to the right button, which is B button.
  3. It will display “SHAKE”
  4. CHASE THE DOT
  5. GREAT!. NOW GET CODING!

This sequence will run each time you power up until you upload your own program to it.

Now, it’s time to start making your own program.

You can go to www.microbitworld.me. There are lots of tutorials and information on the website. You can select your coding editor that you would like to code with.
codingeditor

Let’s try to make a simple code to display word “ONVINETECH”.

  1. Open a web browser and type https://pxt.microbit.org/
  2. Click Input and drag “on button A pressed”
    input
  3. Click Basic and drag a Show String block from the sidebar to the stage
    showstringcode
  4. Click the A button on a micro:bit simulator.
  5. Give it a name and click save, it will automatically download the file to your “Downloads” folder.
  6. Open the Downloads folder click and drag .hex file into microbit drive.
  7. Disconnect it and press the A button, it will display the word “ONVINETECH” across the LED Display.

Let’s follow another tutorial from this website how to create a compass with “If Statement.”

The micro:bit has an on board compass. This compass has to be calibrated the first time that it is used, so that the readings that it produces are accurate. When you load a program into the micro:bit and your program tries to read from the compass, it will scroll the words ‘DRAW A CIRCLE’ on the screen. Hold the micro:bit horizontally and tilt it on the spot trying to fill in the circle, until all the dots are filled and then you see a smiley face. After you have done this, your program will run.

compasscode

Thanks for reading. Have fun and start to coding. Do share with me about your projects using micro:bit.

It’s all about Snapchat

There is a popular mobile app today that allows you to send videos and pictures. Yes, you’ve probably heard someone mention the Snapchat.It’s an app that truly changed how people interact with friends compared to Facebook. It’s popular among the youngest smartphone users and it’s also a fun messaging app.

snapchat

While each Snap can just be an image, you can use Lenses, Filters, Geo-Filters, Stickers, Emoji, text and a drawing tool to personalize them more.

For iPhone user, you can download it from here, and for Android user, you can download it from here.

One of the most unique things about Snapchat is, photo and video will disappear a few seconds after they’ve been viewed by their recipients.

How to create a Snapchat account

  1. Launch Snapchat
  2. Tap Sign Up
  3. Enter your name and tap Sign Up & Accept.
  4. Enter your birthday
  5. Pick a username
  6. Enter a password
  7. Enter your email address.
  8. Verify your phone number
  9. You are ready to go to use the app.

Tips for Mac OS-X user

  1. Adding a signature to your picture. Open a picture in Preview and click Tools->Annotate ->Signature ->Manage Signature.
    Follow the on-screen instructions to add a signature. You can save your signature for future use as well.

  2. You can get exchange rate and convert currency with Spotlight in El Capitan. The currency conversions are done with Calculator app by gathering exchange rates from Yahoo, but the data is obviously aggregated into Spotlight for convenience.converter.png
  3.  Built-in emoji Press ctrl ++ space to open the window. This window contains an exhaustive list of special characters. You can choose the special characters and emoticons that you need from this window.emoji.png
  4. Speech to text conversion you can convert your speech-to-text by pressing the function (fn) key twice and begin speaking. Your voice gets converted to text when you press function (fn) key one more time. The OS X types out as you speak.speech.png
  5.  Hot Corners.
    You can enable hot corner setting from System Preferences -> Desktop & Screen Savers ->Screen Saver Tab -> Hot Corners
    There are 9 options you can select of Start Screen Saver, Disable Screen Saver, Mission Control, Application Windows, Desktop, Dashboard, Notification Center, Launchpad and Put Display to Sleep.hot-corners

The Secret Lego Batman with Siri

The Lego Batman Movie is back and insanely popular. Really.. It was awesome!! In the movie, the voice of Batcomputer is voiced by Siri. So now you know that you can try it at home too.

Here’s a secret, whenever you say “Hey Computer”  or “Puter” to Siri, Siri will respond to you as if you are Batman.

Here are a few funny responses I’ve got. They do repeat randomly, so you just have to say “Hey Computer” a few times to get them all.

“Hello, sir. I’ve heated up your lobster thermidor in the microwave. I’m one step ahead of you, Alfred.”

“Hello, sir. Alfred is on the 17th floor, caulking the tiles in the second bathroom of the fifth master bedroom.”

“Welcome home, sir. I have your rom coms queued up, sorted by decade.”

Give it a try on your own iPhone, and let me know what kind of responses you get from Siri in the comments section below.

Have Fun!!!

 

 

 

 

New Macbook Pro with Touch Bar and Touch ID

mbp15touch-gray-select-201610

The new MacBook Pro’s Touch Bar has arrived with something much more versatile and capable. The Touch Bar replaces the function keys that have long occupied the top of your keyboard. System controls like volume and brightness, intelligent typing features like emoji and predictive text, and more.

After a brief beta preview, Microsoft is rolling out support for the Macbook Pro Touch Bar to all users of Office for Mac.

For Word, you can enter Word Focus Mode a brand-new experience that hides all of the on-screen ribbons and commands so you can simply focus on your work. You can also now insert comments, photos or hyperlinks directly from Touch Bar. Keeping them available to use, but not distracting the user.

wordmode

For PowerPoint it allows you to easily manipulate graphic elements.  You can easily rotate an object to get just the right angle. Controls are now available on the Touch Bar when your presentation is available in Slideshow View, including slide thumbnails and a timer to help you keep track of time as you present.

pps

For Excel the Touch Bar will show recently used functions in Excel, allowing users to quickly select a commonly used formula. The Touch Bar also provides quick access to charts an making it easier than ever to organize and visualize your data.

excel

For Outlook, when composing a new mail, the Touch Bar displays a list of recent documents as well as the ability to join a Skype for Business meeting.

skype

Embedding a 360 panorama in a wordpress website

Recently I read this article about embedding VR view from Google VR documentation, so I thought I will give it a try to embed the picture to a website page using one sample taken by Cardboard Camera App.

1.Download the open source code for VR view on the web via GitHub.

github_vrview

2. Copy vrview-master.zip file to your wordpress and extracted it, mine is in cPanel.

3. Convert your picture taken by Cardboard Camera App.

4. Copy paste this and edit accordingly.

//storage.googleapis.com/vrview/index.html?image=//storage.googleapis.com/vrview/examples/coral.jpg&is_stereo=true

Here is the result

Enjoy..