Version: 1.9.8
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
| pick d0d13d0 1:removed some bullshit from __entrypoint.d _________9______ | |
| pick a44e878 2:Improvements to object.d and __entrypoint.d ________89______ | |
| pick 12c5b47 3:Add usage to build.d ___3____________ | |
| pick 318af43 4:Added .gitignore ______________e_ | |
| pick eb9ad0f 5:Attempting to add more array support _1_3_56_89abcd__ | |
| pick 8b8df05 6:Added some special support for ldc to object.d ________8_______ | |
| pick e630300 7:Removed imports from build ___3____________ | |
| pick 69ae673 8:c-main to d-main __2345_7_9______ | |
| pick c00b344 9:Implemented write an exit system calls _1_345678_______ | |
| pick 3901cca 10:Add wscript_build file 0__3____________ |
| # Borrowed from https://github.com/y310/rspec-retry/blob/master/lib/rspec/retry.rb | |
| CAPYBARA_TIMEOUT_RETRIES = 3 | |
| RSpec.configure do |config| | |
| config.around(:each, type: :feature) do |ex| | |
| example = RSpec.current_example | |
| CAPYBARA_TIMEOUT_RETRIES.times do |i| | |
| example.instance_variable_set('@exception', nil) | |
| self.instance_variable_set('@__memoized', nil) # clear let variables |
There is a bug in PhantomJS on Mac OS X that doesn't render an HTML page as selectable text. It will be fixed in PhantomJS 2.0, so for now you'll have to apply a patch when installing with Homebrew.
First, update homebrew formulae:
$ brew update
If you already have PhantomJS installed, then remove it:
$ brew uninstall phantomjs Next, the PhantomJS formula needs to be edited to apply a patch that fixes native text rendering in Mac OS X:
When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.
There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the
| defmodule RestClient do | |
| require Logger | |
| alias Poison, as: JSON | |
| @baseurl "http://someapi.com" | |
| @username "username" | |
| @password "password" | |
| def get_by_path(path, id, params) | |
| when is_binary(id) or is_integer(id) and is_list(params) do |
| #!/bin/sh | |
| # | |
| if [ "X$SSH_AUTH_SOCK" = "X" ]; then | |
| eval `ssh-agent -s` | |
| ssh-add $HOME/.ssh/id_rsa | |
| fi | |
| HOST= | |
| REDIS_SLAVE_PORT=6000 |
| FROM elixir:1.2.3 | |
| MAINTAINER Sergey Gernyak <sergeg1990@gmail.com> | |
| ENV MIX_ENV=prod | |
| RUN apt-get update && apt-get install -y build-essential git-core | |
| RUN mkdir -p /app | |
| WORKDIR /app |
It's pretty easy to do polymorphic associations in Rails: A Picture can belong to either a BlogPost or an Article. But what if you need the relationship the other way around? A Picture, a Text and a Video can belong to an Article, and that article can find all media by calling @article.media
This example shows how to create an ArticleElement join model that handles the polymorphic relationship. To add fields that are common to all polymorphic models, add fields to the join model.
| package demo | |
| import io.vertx.core.Vertx | |
| import io.vertx.core.http.HttpServer | |
| import io.vertx.core.http.HttpServerResponse | |
| import io.vertx.ext.web.Route | |
| import io.vertx.ext.web.Router | |
| import io.vertx.ext.web.RoutingContext | |
| fun Router.get(path: String, handler: (RoutingContext) -> Unit): Route { |