pushd to save an array of working directories
❤ sites mkdir sandbox
❤ sites cd sandbox
❤ sandbox pushd ~/Downloads/php-master
~/Downloads/php-master ~/sites/sandbox ~/sites ~
dirs to return the array
Download Oracle InstantClient basic, sqlplus, and SDK packages
instantclient-basic-macos.x32-11.2.0.4.0.zip
instantclient-sqlplus-macos.x32-11.2.0.4.0.zip
instantclient-sdk-macos.x32-11.2.0.4.0.zip
Extract files and rename directory, if desired
/instantclient
|
| #! /bin/sh | |
| function help () { | |
| echo "jazz - A simple script that makes using the Jasmine testing framework in a standalone project a little simpler." | |
| echo "" | |
| echo " jazz init - include jasmine in the project"; | |
| echo " jazz create FunctionName - creates ./src/FunctionName.js ./spec/FunctionNameSpec.js"; | |
| echo " jazz run - runs tests in browser"; | |
| } |
Download JDK 7 for OS X x64 and follow the installation wizard.
Add JAVA_HOME to env variables in .bash_profile, .bashrc or .zshrc
export JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home'
Add java_home alias to .bash_profile, .bashrc or .zshrc
alias java_home='/usr/libexec/java_home'
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
| def even_fibonacci_numbers | |
| fibonacci_numbers.select {|n| n.even? }.reduce(:+) | |
| end | |
| def fibonacci_numbers | |
| numbers = [1, 2] | |
| while numbers[-1] < 4_000_000 do | |
| numbers << numbers[-2] + numbers[-1] | |
| end | |
| numbers[0..-2] |
| 1.upto(999).select do |n| | |
| n % 3 == 0 || n % 5 == 0 | |
| end.reduce(:+) |
| def fizzbuzz(n) | |
| 1.upto(n).map do |num| | |
| response = "" | |
| response << "Fizz" if num % 3 == 0 | |
| response << "Buzz" if num % 5 == 0 | |
| response.empty? ? num : response | |
| end | |
| end |
| def largest_product(digits) | |
| product_of_five(digits).max | |
| end | |
| def product_of_five(digits) | |
| digit_array = digits.to_s.split("") | |
| digit_array[0..-5].map.with_index do |digit, i| | |
| digit.to_i * digit_array[i+1].to_i * digit_array[i+2].to_i * digit_array[i+3].to_i * digit_array[i+4].to_i | |
| end | |
| end |
| def solution(digits) | |
| group_by_five(digits).max | |
| end | |
| def group_by_five(digits) | |
| digits.split("")[0..-5].map.with_index do |digit, i| | |
| "#{digit}#{digits[i+1]}#{digits[i+2]}#{digits[i+3]}#{digits[i+4]}" | |
| end | |
| end |