Monday, October 17, 2016

Learn Ruby Metaprogramming for Great Good

[caption id="attachment_141384" align="alignnone" width="1912"]Rr Ruby Metaprogramming can be a good thing.[/caption]

Recently, I was reviewing one of my student's code. He had a program with many methods that printed out various messages, for example:

class MyClass
  def calculate(a)
    result = a ** 2
    puts "The result is #{result}"
  end
end

class MyOtherClass
  def some_action(a, b)
    puts "The first value is #{a}, the second is #{b}"
  end

  def greet
    puts "Welcome!"
  end
end

I suggested that he store these messages in a separate file to simplify the process working with them. Then, I remembered how I18n translations are stored in Rails and got an idea. Why don't we create a YAML file (a so-called dictionary) with all the messages and a helper method to fetch them properly, all while supporting additional features like interpolation? This is totally possible with Ruby's metaprogramming!

Continue reading %Learn Ruby Metaprogramming for Great Good%


by Ilya Bodrov-Krukowski via SitePoint

The “Most Loved” One Page Websites in September – presented by Bluehost

one-page-love-hosting-reviews-bh-unlimitedSeptember’s “Most Loved” One Page website round-up is brought to you by hosting provider, Bluehost.

Bluehost is the affordable hosting option to host your One Page website. Pricing starts at only $3.49/month where you can host your website with 100GB diskspace and bandwidth.

Next tier up is $5.95/month where you can have unlimited sites, disk space and bandwidth. They are very well established and have a huge support team 24-7. Learn more about Bluehost.

If you want to receive these “Most Loved” awards in your inbox each month, subscribe to our Inspiration Newsletter.

Below are 7 One Page websites we awarded “Most Loved” in September – hope you enjoy!


macOS Sierra on your MacBook Pro (Product, Informational)

Beautiful horizontal scrolling One Pager by Apple demonstrating all the nifty things you can do on your MBP with the new macOS, Sierra. As you would expect from Apple – gorgeous whitespace, crisp typography and lovely animations demonstrating each feature. This Single Page site is actually part of their support centre interesting enough.

Launch Website
Full Review


GitHub Octoverse 2016 (Annual Report)

Annual report One Pager highlighting the incredible past year at GitHub. The super long scrolling Single Page website features impressive statistics, lovely SVG infographics and even an awesome parallax scrolling planet section (that adapts to a stacked layout on mobile!) further down.

Launch Website
Full Review


Projekcje – The Graphic Design Battles (Competition, Event, Landing Page)

Gorgeous load transitions and subtle parallax effects in this colorful One Pager promoting the ‘Graphic Design Battle’ held at the Projekcje conference. The Single Page website features an excellent responsive layout that fills a big screen so well. Other highlights include a lovely typography blend, clean flat design elements and great to see that extra effort with a slick application form styled inline with the site design. (If you’re wondering why we are allowing this site in with a big navigation to other pages is that it is hosted on a subdomain and simply links back to the main event site. This One Pager acts as the landing page for the competition at the event – we wouldn’t allow it if it wasn’t on a subdomain.)

Launch Website
Full Review


Apple Plug (Product)

Hilarious One Pager for the ‘Apple Plug’ that takes a jab at Apple’s new iPhone 7 announcement with no headphone socket. The execution is perfect with a matching Myriad Pro font, lovely parallax scrolling of products and on-point copy. I’m not sure how long this will last online but stoked we’ve “preserved” it on One Page Love:)

Launch Website
Full Review


Trinipedia (App)

Gorgeous parallax scrolling in this One Pager promoting a new Augmented Reality app called Trinipedia. The long scrolling Single Page website is bursting with colorful illustration and incredible animations. Make sure you check the impressive angled demo in the How it Works section. Brilliant work as usual by Garden Estúdio!

Launch Website
Full Review


Decade in Design (Announcement)

Special One Pager by Elegant Seagulls celebrating ten successful years in business. The long scrolling Single Page website has good focus on the team behind all their great work including bios and thank you notes from each. Features include big typography, company timeline (with lovely responsive adaption), client milestones and a nice little Dribbble infographic section. Awesome to see it’s built on WordPress too!

Launch Website
Full Review


Resn (Portfolio)

Phenomenal One Page website for New Zealand based digital agency, Resn. The Single Page website starts with 6 unique sections where you hold your cursor down to load the interactive animations. Each incredibly impressive. Clicking top-right reveals the menu where you navigation swiftly to their work. The transitions are gorgeous and overall execution just top drawer. Easy contender for One Pager of the year.

Launch Website
Full Review


Hope you enjoyed these beautiful One Pagers from September! Big love to hosting provider Bluehost for sponsoring the round up:)


by Rob Hope via One Page Love

Simone Viani

Simone Viani

Simple resumé-style One Pager for Simone Viani - except with an interactive game of Ping Pong in the background:) Cheers for the build notes!

by Rob Hope via One Page Love

Madebyvadim

Madebyvadim

Horizontal accordion layout in this One Pager for Vadim Sherbakov - a digital producer whose work you've probably seen dominating Creative Market. Usability wise this multi-scrolling layout is not for everyone but it's definitely unique. When you drag the accordion open to the photography section - then hold down your cursor - I just love how the background slideshow image correlates with the underlined keyword within the page copy.

by Rob Hope via One Page Love

AtoZ CSS Screencast: The CSS Quotes Property

Single and double quotes appear frequently when writing code.

However, when displaying any quoted text like the q element or when using apostrophes, we should use smart quotes.

These are often added by the browser, but we can control their appearance and the choice of character from CSS.

In this episode about we’ll learn all about:

  • the difference between dumb quotes and smart quotes
  • the different styles of quotes used internationally
  • and the somewhat under-used CSS quotes property

Smart or Dumb?

When we create a string of text in a code editor, we use “dumb quotes”.

These are either ‘single quotes’ or “double quotes” and are straight. The same character is used at the beginning of the string as at the end.

Smart quotes are the correct typographic choice for any quotes or apostrophes that are displayed in the browser. They are often curly or sloped and the start and end quotes are often different.

If your document uses the utf-8 character set you can add smart quotes directly into the HTML with the following keyboard shortcuts on a Mac:

‘ ⌥+]
’ ⌥+⇧+]
“ ⌥+[
” ⌥+⇧+[

And on Windows:

‘ alt+0145
’ alt+0146
“ alt+0147
” alt+0148

Alternatively, the character entities can be used:

‘ ‘
’ ’
“ “
” ”

Continue reading %AtoZ CSS Screencast: The CSS Quotes Property%


by Guy Routledge via SitePoint

Building Your Startup: The Open-Source Foundation Behind Meeting Planner

Discover Your Patronus

The experience transports users into a 3D environment where those taking part will make a series of choices based on a set of cryptic prompts, eventually discovering their Patronus.
by via Awwwards - Sites of the day