Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112
For older versions of Spark and ipython, please, see also previous version of text.
Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112
For older versions of Spark and ipython, please, see also previous version of text.
| AllCops: | |
| RunRailsCops: true | |
| # Commonly used screens these days easily fit more than 80 characters. | |
| Metrics/LineLength: | |
| Max: 120 | |
| # Too short methods lead to extraction of single-use methods, which can make | |
| # the code easier to read (by naming things), but can also clutter the class | |
| Metrics/MethodLength: |
SSH into Root
$ ssh [email protected]
Change Root Password
Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.
Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.
As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.
Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.
| StandardError | |
| SQLite3::Exception | |
| SQLite3::MemoryException | |
| SQLite3::LockedException | |
| SQLite3::BusyException | |
| SQLite3::AbortException | |
| SQLite3::PermissionException | |
| SQLite3::InternalException | |
| SQLite3::SQLException | |
| SQLite3::NotADatabaseException |
| # Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed. | |
| # We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
| # Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
| # | |
| # Deployment structure | |
| # | |
| # SERVER: | |
| # /etc/init.d/nginx (1. nginx) | |
| # /home/app/public_html/app_production/current (Capistrano directory) | |
| # |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
This gist assumes:
| # To check if this is up-to-date with the tax rates go to | |
| # http://www.expatax.nl/tax-rates-2016.php and see if there's anything | |
| # newer there. | |
| # | |
| # I make no guarantees that any of this is correct. I calculated this | |
| # at the time and have been updating it when new tax rates come along | |
| # because people keep finding this useful. | |
| # | |
| # There's also an interactive JS version of this created by | |
| # @stevermeister at |