Mountain Lion (10.8) has three main difference compared to Lion (10.7):
- XCode 4.4 does not install Command Line Tools by default
- X11 isn't available anymore
- The installed version of OpenSSL has some bugs
| #!/usr/bin/env ruby | |
| # Put this file in the root of your Rails project, | |
| # then run it to output the SQL needed to change all | |
| # your tables and columns to the same character set | |
| # and collation. | |
| # | |
| # > ruby character_set_and_collation.rb | |
| DATABASE = '' |
| authors: | |
| hanzou: | |
| name: Hanzou Hattori | |
| display_name: Hanzou | |
| gravatar: c66919cb194f96c696c1da0c47354a6a | |
| email: hanzou@company.com | |
| web: http://company.com | |
| twitter: company | |
| github: hhattori | |
| jorgen: |
| paginate: 10 |
| var MoonInfo = function(day, month, year) { | |
| var n0 = parseInt( "0" ); | |
| var f0 = parseFloat( "0.0" ); | |
| var AG = f0; // Moon's age | |
| var DI = f0; // Moon's distance in earth radii | |
| var LA = f0; // Moon's ecliptic latitude | |
| var LO = f0; // Moon's ecliptic longitude | |
| var Phase = " "; | |
| var Zodiac = " "; |
| # First, make sure that you have the most recent rvm. Several bugs with 2.0.0-preview1 | |
| # have recently been fixed. | |
| # | |
| # Second, the openssl that comes with MacOS is too old for Ruby 2.0. You need to install | |
| # a newer one with homebrew or the rvm pkg command. | |
| # Option 1, with homebrew openssl: | |
| brew update | |
| brew install openssl |
| # Use Homebrew and be happy. | |
| brew update | |
| brew install opencv | |
| # Give the correct pathnames. Of course, `2.4.3` is the current version at this time, change it accordingly. | |
| gem install ruby-opencv -- --with-opencv-lib=/usr/local/Cellar/opencv/2.4.3/lib \ | |
| --with-opencv-include=/usr/local/Cellar/opencv/2.4.3/include/opencv \ | |
| --with-opencv-include=/usr/local/Cellar/opencv/2.4.3/include/opencv2 |
| def confirmation(credentials) | |
| return false if params['ds_signature'].blank? | |
| # The DES3-CBC key generation it's the same that in the creation gist | |
| # You can take a look at the explanation | |
| secret_key = credentials[:secret_key] | |
| secret_key_base64 = Base64.strict_decode64(secret_key) | |
| des3 = OpenSSL::Cipher::Cipher.new('des-ede3-cbc') | |
| block_length = 8 | |
| des3.padding = 0 |
| require 'net/http' | |
| require 'uri' | |
| require 'json' | |
| def open(url) | |
| Net::HTTP.get(URI.parse(url)) | |
| end | |
| page_content = open('http://www.loteriasyapuestas.es/servicios/premioDecimoProvisionalWeb') | |
| res_json = JSON.parse(page_content) |
This is my best try at transcribing of the lightning talk I gave at RUG::B on April 2016. Due to poor time management (LOL) the delivery was rushed and some examples were skipped, I hope having them posted here makes them more useful.
xargs is a small but very useful program that is installed in most if not all of your computers¹. Many of you probably know it. Those who don't will learn something really useful, but those who do will learn a couple of cool tricks, too.
You might have heard about the Unix philosophy: