This is now an actual repo:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var del = require('del'); | |
| var uglify = require('gulp-uglify'); | |
| var gulpif = require('gulp-if'); | |
| var exec = require('child_process').exec; | |
| var notify = require('gulp-notify'); |
Tested on Yosemite. Should work on El Cap. Message me if it doesn't.
- You are tired of using vagrant
- You want to run guard
- You want use Sublime plugins (like RSpec or Guard plugins)
- You want your code to run faster in development
Command Line
pry -r ./config/app_init_file.rb- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb- load your rails into a pry session
Debugger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'benchmark' | |
| # Sort the array from lowest to highest | |
| def sort(arr) | |
| swap = true | |
| # Merge sort | |
| while swap | |
| swap = false | |
| for i in 0..arr.length - 1 | |
| if i <= arr.length - 2 && arr[i] > arr[i + 1] | |
| greater = arr[i] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Find the maximum | |
| def maximum(arr) | |
| result = nil | |
| if !arr.is_a? (Array) | |
| result = "not an array" | |
| else | |
| arr.each { |i| result = i if result == nil || i > result} | |
| return result | |
| end | |
| end |