Skip to content

Instantly share code, notes, and snippets.

@D1plo1d
D1plo1d / asuser.rb
Created August 15, 2012 03:03 — forked from bmc/asuser.rb
Run block as another user, in subprocess
require 'etc'
def as_user(user, &block)
# Find the user in the password database.
u = (user.is_a? Integer) ? Etc.getpwuid(user) : Etc.getpwnam(user)
# Fork the child process. Process.fork will run a given block of code
# in the child process.
Process.fork do
# We're in the child. Set the process's user ID.
// ==========================================================================
// Project: CamUi - mainPage
// Copyright: ©2010 My Company, Inc.
// ==========================================================================
/*globals CamUi */
ControlPanelView = SC.StackedView.extend({
childViews: 'axialCmdButtons axisSelectionLabel axisSelectionRadio momementModeLabel movementModeRadio feedrateLabel feedrateSlider'.w(),
useStaticLayout: YES,