
Security Fundamentals
Obfuscation 101: Unmasking the Tricks Behind Malicious Code
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
A nice way to use iOS6+ autolayout in your RubyMotion app. Use ASCII-art inspired format strings to build your app's layout!
Add this line to your application's Gemfile:
gem 'motion-layout'
And then execute:
bundle
Or install it yourself as:
gem install motion-layout
Then in your Rakefile
:
require 'motion-layout'
Using AutoLayout is a way to put UI elements in your iPhone app without using Interface Builder, and without being very specific about pixel sizes, locations, etc. The layout strings are ASCII inspired, and Apple's documentation on the Visual Format Language is a necessary read and reference.
Here's an example of Motion::Layout
usage from inside of Basecamp for iPhone on a UITableView
's tableFooterView
:
Motion::Layout.new do |layout|
layout.view self.view.tableFooterView
layout.subviews "switch" => @switch, "help" => @help
layout.vertical "|-15-[switch]-10-[help(==switch)]-15-|"
layout.horizontal "|-10-[switch]-10-|"
layout.horizontal "|-10-[help]-10-|"
end
And here's an example you can run right inside this repo, the Time app converted to use Auto Layout from the RubyMotionSamples repo:
Motion::Layout.new do |layout|
layout.view view
layout.subviews state: @state, action: @action
layout.metrics "top" => 200, "margin" => 20, "height" => 40
layout.vertical "|-top-[state(==height)]-margin-[action(==height)]"
layout.horizontal "|-margin-[state]-margin-|"
layout.horizontal "|-margin-[action]-margin-|"
end
I couldn't figure out how to test this automatically. Run bundle
to get the gems you need, and then rake
to generate a RubyMotion app in the iOS simulator
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)MIT. See LICENSE
.
FAQs
Unknown package
We found that motion-layout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Security News
Biome's v2.0 beta introduces custom plugins, domain-specific linting, and type-aware rules while laying groundwork for HTML support and embedded language features in 2025.