This is a recreation of Android L's toggle menu icon in the action bar. The icon morphs into a back button when toggled.
A Pen by Jaune Sarmiento on CodePen.
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
# reset the index to the desired tree | |
git reset 56e05fced | |
# move the branch pointer back to the previous HEAD | |
git reset --soft HEAD@{1} | |
git commit -m "Revert to 56e05fced" | |
# Update working copy to reflect the new commit | |
git reset --hard |
# exit vim temporarily | |
ctrl + z | |
# go back to vim | |
$ fg |
class MyTableViewController < UITableViewController | |
attr_accessor :datasource | |
def numberOfSectionsInTableView(table_view) | |
# Usually just 1 | |
1 | |
end | |
def tableView(table_view, numberOfRowsInSection: section) |
class MyViewController < UITableViewController | |
attr_accessor :datasource | |
# .. UITableViewController delegate methods here .. | |
def prepareForSegue(segue, sender: sender) | |
if (segue.identifier.isEqualToString("segueIdentifier")) | |
index_path = @datasource.indexPathForSelectedRow | |
destination_view_controller = segue.destinationViewController |
class AppDelegate | |
attr_accessor :window, :storyboard | |
def application(application, didFinishLaunchingWithOptions: launchOptions) | |
# Switch to a new rootViewController with transition | |
UIView.transitionWithView( | |
@window, | |
duration: 0.5, |
# -*- coding: utf-8 -*- | |
$:.unshift("/Library/RubyMotion2.18/lib") | |
require 'motion/project/template/ios' | |
begin | |
require 'bundler' | |
require 'bubble-wrap' | |
require 'motion-stump' | |
require 'sugarcube-repl' | |
Bundler.require |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
function toCurrency(f) { | |
var fs = f.split('.'); | |
var rs = fs[0].split('').reverse().join(''); | |
var i = 0; | |
var ns = ''; | |
while (i < rs.length) { | |
ns += (i % 3 == 0) ? ',' + rs[i] : rs[i]; | |
i++; | |
} | |
return ns.slice(1).split('').reverse().join('') + '.' + ((fs[1] === undefined) ? '00' : fs[1]); |