Recent releases have been pre-built using cross-compilers and this script and are downloadable below.
If you have found these packages useful, give me a shout out on twitter: @adammw
| var express = require('express'), | |
| passport = require('passport'), | |
| TwitterStrategy = require('passport-twitter').Strategy, | |
| ensureLoggedIn = require('connect-ensure-login').ensureLoggedIn, | |
| app = express(); | |
| app.use(express.static(__dirname + '/public')); | |
| app.use(express.cookieParser()); | |
| app.use(express.session({ secret: 'keyboard cat' })); | |
| app.use(passport.initialize()); |
| class SimpleLinearRegression | |
| def initialize(xs, ys) | |
| @xs, @ys = xs, ys | |
| if @xs.length != @ys.length | |
| raise "Unbalanced data. xs need to be same length as ys" | |
| end | |
| end | |
| def y_intercept | |
| mean(@ys) - (slope * mean(@xs)) |
Recent releases have been pre-built using cross-compilers and this script and are downloadable below.
If you have found these packages useful, give me a shout out on twitter: @adammw
| class Notifier | |
| constructor: -> | |
| @enableNotification = false | |
| @checkOrRequirePermission() | |
| hasSupport: -> | |
| window.webkitNotifications? | |
| requestPermission: (cb) -> | |
| window.webkitNotifications.requestPermission (cb) |
| require 'parallel' # gem install parallel (https://github.com/grosser/parallel) | |
| # Monkey patch to Sprockets::StaticCompiler, a class provided by actionpack | |
| # that's used by the assets:precompile task. This patch uses the Parallel gem | |
| # to parallelize asset compilation in the simplest way possible. | |
| # | |
| # Parallel wraps Process.fork to handle things like inter-process communication | |
| # via pipes and determining the maximum number of processes to run based on | |
| # your system's total logical processors. So far only tested on MRI 1.9.3 on OS X. | |
| module Sprockets |
Start XCode and create a new Storyboard file. I closed all my other XCode projects. When you choose the location of the created file, it should be your RubyMotion project's resources directory. Add a UIViewController, and set it's identifier property to "Start". Add some UI elements so you can see it working.
When you run rake in your RubyMotion project, it will compile the .storyboard file. You could auto-load the Storyboard using a plist configuration, but you'll see code can do it too.
| require 'rubygems' | |
| require 'nokogiri' | |
| require 'colored' | |
| PROJECT_NAME="GolfStatus" | |
| PROJECT_ROOT = File.dirname(__FILE__) | |
| IPHONE_SDK_VERSION="4.3" | |
| TI_SDK_VERSION="1.6.2" | |
| TI_DIR='/Library/Application\ Support/Titanium' |
| # autoload concerns | |
| module YourApp | |
| class Application < Rails::Application | |
| config.autoload_paths += %W( | |
| #{config.root}/app/controllers/concerns | |
| #{config.root}/app/models/concerns | |
| ) | |
| end | |
| end |
| if Rails.env.production? | |
| Braintree::Configuration.environment = Rails.env.staging? ? :sandbox : :production | |
| Braintree::Configuration.merchant_id = ENV["braintree_merchant_id"] | |
| Braintree::Configuration.public_key = ENV["braintree_public_key"] | |
| Braintree::Configuration.private_key = ENV["braintree_private_key"] | |
| else | |
| Braintree::Configuration.environment = :sandbox | |
| Braintree::Configuration.merchant_id = "<super secret>" | |
| Braintree::Configuration.public_key = "<super secret>" | |
| Braintree::Configuration.private_key = "<super secret>" |
| #! /usr/bin/env ruby | |
| status = DATA.flock(File::LOCK_EX | File::LOCK_NB) | |
| if status == 0 | |
| puts "we have the lock..." | |
| sleep | |
| else |