Skip to content

Instantly share code, notes, and snippets.

View eriktrautman's full-sized avatar
🔥

E-rock T-raut eriktrautman

🔥
View GitHub Profile
> sudo npm install
> fsevents@1.2.4 install /Users/eriktrautman/Documents/NEARStudio/node_modules/fsevents
> node install
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v67-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.4 and node@11.1.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! System Darwin 17.7.0
@eriktrautman
eriktrautman / sublime_text_2_preferences
Last active January 12, 2018 03:31
Sublime Text 2 User Preferences
// These settings can be found under Sublime Text 2 >> Preferences >> Settings - User
// You can just copy-paste this file right over whatever was there if you want
//
// Check out the file at Sublime Text 2 >> Preferences >> Settings - Default
// to see what options are available for you
{
"color_scheme": "Packages/Color Scheme - Default/LAZY.tmTheme",
"font_size": 14.0,
"ignored_packages":
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@eriktrautman
eriktrautman / pass_by_reference.rb
Created January 12, 2013 21:59
Testing whether TestChild is going to be able to modify TestParent's string1 and array1, or, more generally, how to avoid dumb pass-by-reference errors.
# Testing whether TestChild is going to be able to modify TestParent's
# string1 and array1, or, overall, which objects are really pass-by-reference
# and which are not [in this case, testing strings and arrays]
class TestParent
attr_accessor :string1, :array1
def initialize(string1, array1)
@string1 = string1
@array1 = array1
puts
puts "The parent's starting string is: #{@string1}"
@eriktrautman
eriktrautman / testfirst_08.rb
Last active December 10, 2015 16:28
Instance variable scope within a subclass in Ruby... super works to instantiate the subclasses properly but not the factory methods from the Temperature class!
# The subclasses really aren't pretty... I had major issues with
# getting the subclasses access to the instance variables @c and
# @f so they could run the in_celsius and in_fahrenheit methods.
class Temperature
def initialize t
@f = t[:f]
@c = t[:c]
#puts "initialized!!! t = #{t.inspect}, @f is #{@f.inspect} and @c is #{@c.inspect}"
# *****************************************************************************
# Functions:
# *****************************************************************************
# runs the full mergesort algorithm on the inputted array
def mergesort(inarr)
results = []
arrsize = inarr.size