This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This one! | |
def viewNamed(view_name, ofClass: class_reference) | |
var_name = view_name[0].downcase + view_name[1, view_name.length - 1].gsub(/\s/, '') | |
instance_variable_get("@#{var_name}") or instance_variable_set("@#{var_name}", class_reference.new).tap do |view| | |
view.accessibilityLabel = view_name | |
yield view if block_given? | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
totalCombinedViewHeight = 100 | |
Motion::Layout.new do |layout| | |
layout.view view | |
layout.subviews "state" => @state, "action" => @action | |
layout.metrics "margin" => 20, "height" => 40, "halfHeight" => ((view.bounds.size.height - totalCombinedViewHeight) / 2), "halfWidth" => ((view.bounds.size.width - 100) / 2) | |
layout.vertical "|-(<=halfHeight)-[state]-margin-[action]-(>=halfWidth)-|" | |
layout.horizontal "|-margin-[state]-margin-|" | |
layout.horizontal "|-margin-[action]-margin-|" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'Subdomain' | |
CMS::Application.routes.draw do | |
namespace "admin" do |admin| | |
resources :pages # Admin::PagesController Routes | |
end | |
constraints(Subdomain) do | |
match '/' => "pages#root" # Route for Root URL for Subdomains |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd ~user/ProjectRepo | |
env -i git pull |
NewerOlder