Add files to an Xcode project from a script?

Right now I’m using a few scripts to generate files that I’m including as resources in Xcode. The thing is I’m running the script, then deleting from the project, then adding back into the project. There must be a way to automate this last step, so that the script can generate the files and automatically … Read more

How to use ActiveRecord in a ruby script outside Rails?

I have a small ruby script in which I’d like to use ActiveRecord to easily access a database model. What is the best way to do it? Answer require ‘active_record’ # Change the following to reflect your database settings ActiveRecord::Base.establish_connection( adapter: ‘mysql2’, # or ‘postgresql’ or ‘sqlite3’ or ‘oracle_enhanced’ host: ‘localhost’, database: ‘your_database’, username: ‘your_username’, … Read more

Remove quotes from named environment variables in Windows scripts

I want to store a URL prefix in an Windows environment variable. The ampersands in the query string makes this troublesome though. For example: I have a URL prefix of http://example.com?foo=1&bar= and want to create a full URL by providing a value for the bar parameter. I then want to launch that URL using the … Read more

Alternatives to Lua as an embedded language?

I am working on an embedded system running Linux on a DSP. Now we want to make some parts of it scriptable and we are looking for a nice embeddable scripting language. These scripts should integrate nicely with our existing C++ code base, be small and fast. I understand that Lua is the industry choice … Read more

what is a good invalid IP address to use for unit tests?

I am writing unit tests for a client library. I want to test connecting with an invalid port and an invalid ip. What is a good ip address to use that won’t potentially be routed somewhere? I don’t want to make any assumptions about the network the machine running the unit tests is on. LOCALHOST … Read more