Skip to content

Instantly share code, notes, and snippets.

View Supernats's full-sized avatar

Nathan Seither Supernats

View GitHub Profile
@JosephPecoraro
JosephPecoraro / shell-execution.rb
Last active September 10, 2023 10:12
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Synchronous (blocking)
# Returns the output of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@rorysaur
rorysaur / backbone_app_bases.js
Created April 26, 2014 22:04
purpose of app-wide bases in backbone
App.Views.ViewBase = Backbone.View.extend({
childViews: [],
addChild: function(view) {
// etc
},
close: function() {
this.childViews.forEach(function(childView) {
childView.close();