Sometimes, through some firewall or proxy misconfiguration, you might have to deploy to a server that cannot access the git repository. Solution 1: HTTP Proxy (this is the preferred fix...

...SSH can be tunneled over an HTTP Proxy. For example, when the repo is on github, use this: Install socat Add a ~/.ssh/config on the target server(s) with permission...

...other attributes. A hack to fix this is to use faux string interpolation in a single-quoted :conditions string: class User < ActiveRecord::Base has_many :contracts has_one :current_contract...

...class_name => 'Contract', :conditions => '"#{Date.today.to_s(:db)}" BETWEEN start_date AND end_date' end The single quotes around the conditions are not a typo. It's to prevent Ruby from...

--without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/thomas/.rvm/rubies/ruby-1.8.7-p374/bin/ruby extconf.rb:15: undefined method `include_path' for Libv8:Module (NoMethodError) This is caused...

In order to fix that, remove all versions ob 'libv8': gem uninstall libv8 Select gem to uninstall: 1. libv8-3.3.10.2-x86_64-linux 2. libv8-3.11.8.17-x86_64-linux...

...will allow you to use ssh from anywhere. Simply paste the information provided by vagrant ssh-config to your ~/.ssh/config-File: vagrant ssh-config >> ~/.ssh/config Example: $ vagrant ssh-config

...a desired state. Upon creation Vagrant will set up a new VM and add a SSH-Key so you can ssh into the machine. Normally you would switch to the...

...you register a delegated event using on (or the deprecated delegate / live), it is somewhat hard to manually trigger these events manually, e.g. for testing. After trying jQuery's trigger...

...to no avail, I had success by using native Javascript methods to create and dispatch an event. For instance, to trigger a mousedown event: element = $('...').get(0); event = new MouseEvent...

...wanted autocompletion for paths from paths.rb in Cucumber? This card lets you write your steps like this: When I go to path *press tab now* # path is replaced with a...

...list of all known Cucumber paths This is how you do it (key shortcuts apply for TextMate2) Open the bundle editor (ctrl + alt +  + B) Create a new Item ( + N), select...

While you can use Apache as a reverse proxy, it tries to be too smart. Try nginx instead, it's much simpler to set up. After struggling with Apache for...

...quite a while, since I simply could not make it pass through the Digest Authentication of my target host (that I proxied to), I switched to nginx. Here is what...

makandra dev

...entered the unmistakeable file extension like material_orders_controller.rb, this may help you: Causing the Problem Sometimes you create a new file and forget to enter the ending like material_orders_controller...

...Rubymine handles such files per default as simple txt files. You delete this file and create a new one with correct ending: material_orders_controller.rb. But still Rubymine treats this file as...

makandra dev

...look like this: # Begin Whenever generated tasks for: project100 MAILTO="log@example.com" MAILFROM="cron@example.com" # When server is booting up, ensure Sidekiq is running @reboot start_sidekiq 23 8 * * * baz 30 * * * * plop...

...generated tasks for: project100 While you can human-parse this one easily, crontabs with several lines are hard to read. The following command will ignore any comments or environment variables...

The following snippet demonstrates how you could create excel files (with spreadsheet gem) and format columns so that they follow a specific number format like currencies or dates do.

require 'spreadsheet' Spreadsheet.client_encoding = 'UTF-8' book = Spreadsheet::Workbook.new sheet1 = book.create_worksheet :name => 'test' money_format = Spreadsheet::Format.new :number_format => "#,##0.00 [$€-407]" date_format = Spreadsheet::Format.new :number_format => 'DD.MM.YYYY...

Isolate scopes offer three kinds of variable binding. One of them is &, allowing to bind a property of the isolate scope to a function in the parent scope. Example:

@app.directive 'panel', -> scope: parentFn: '&proxy' link: (scope) -> scope.parentFn(arg1: 'first', arg2: 'second') In this dumb example, the panel directive will call its scope's parentFn() function with two arguments...

stackoverflow.com

...the details container: {{ content }} ngClass will be taking care of updating the details container's slide-index-N class; e.g. when the currentSlideIndex changes from 4 to 5, the slide...

...index-4 class is being removed and the slide-index-5 class is being added. CSS With ngAnimate included, ngClass will add certain animation classes. In the above example, it...

github.com

...Rails 3.2, Rails 4.2 and Rails 5.0. Basic Usage Our example will be a simple address book: class Contact < ActiveRecord::Base validates_presence_of :name, :street, :city, :email end

...create a new class ContactFilter that will describe the searchable columns: class ContactFilter include Minidusen::Filter filter :text do |scope, phrases| columns = [:name, :email] scope.where_like(columns => phrases) end

...may want to know the current commit. [1]\ Luckily, there is lots of useful stuff in the .git directory. Commit hash that you are currently applying cat .git/rebase-merge/stopped-sha

...you want to inspect the original commit for its changes, for example like: git show `cat .git/rebase-merge/stopped-sha` Current commit's message cat .git/rebase-merge/message In case you forgot what the changes...

makandra dev

It's like a GUI for the famous git add [-p]. Select files with the up/down-keys and hit u for staging/unstaging the whole file Enter for showing the diff of...

j and k to navigate in the diff u again to stage/unstage chunks 1 to stage/unstage only lines \ to split large chunks F5 to refresh the view

ImageMagick can automatically crop surrounding transparent pixels from an image: convert input.png -trim +repage output.png You need to +repage to update the image's canvas, or applications will...

...be randomly confused. Trimming specific colors is also possible, see the documentation. Resizing into a box Occasionally, you want to resize an image to a maximum width or height, and...

makandra dev
plugins.jquery.com

SudoSlider is a simple yet powerful content slider that makes no (or very few) assumptions about your markup and is very customizable. You can basically embed any HTML into the...

...slides, so you can mix images, videos, texts, and other stuff. Check out the demos. Please note: There is a ton to configure. Check the demos and read the docs...

If you save a non-standard object (not a String or Fixnum, etc) like the AwesomeClass from your application in the session of visitors be prepared that some time you...

...will get this exception: ActionController::SessionRestoreError: Session contains objects whose class definition isn't available. Remember to require the classes for all objects kept in the session. (Original exception: ...)

makandra dev

Sometimes your code has long lines: describe 'foo' do describe 'bar' do really_long_line_really_long_line_really_long_line another_line When you're working with multiple editor...

...really_long_line_really_long_| another_line | To help with this you can activate Soft wraps in the RubyMine options under General → Editor . Your code will now look like this...

...it might be unavoidable to have different CSS rules for Internet Explorer than for sane browsers. Using Sass, this can be achieved in a relatively non-hackish way without CSS...

Step 1 Move your current Sass file into a partial. Let's assume it was called screen.sass. Rename it _screen.sass. Step 2 Create two new Sass files:

If your requests blow up in Ruby or CURL, the server you're connecting to might only support requests with older SSL/TLS versions. You might get an error like: OpenSSL...

...SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=unknown state SSL Server Test This SSL Server Test can help finding out which SSL/TLS versions the server can handle...

github.com

FactoryBot allows a :class option to its factory definitions, to set the class to construct. However, this option is not supported for traits. Most often, you can just define a...

If you need/want to use traits instead (for example, it might make more sense semantically), you can not use a :class on a trait. In that case, use initialize...

The way MySQL's FULLTEXT tokenizer splits text into word tokens might not always be what you need. E.g. it splits a word at period characters. Since the tokenizer has...

...near-zero configuration options (minimum word length and stopwords list), you need to hack it. There are three options available. Option 1: If you like pain Write a Full-Text...

makandra dev

...id attributes for fields again. This card presents you with a way to call something like - form_for @user, :prefix => 'overlay' do |form| = form.text_field :email and get this as...

...we would not want to pass an overlay_user[email] param to the controller. Setting :id explicitly will not be affected by the prefix. First, have your FormBuilder keep the...