Skip to content

Instantly share code, notes, and snippets.

View kostia's full-sized avatar

Kostia Newt kostia

  • JustRelate
  • Berlin, Germany
View GitHub Profile
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Hangout Starter">
<Require feature="rpc" />
<Require feature="views" />
<Require feature="locked-domain" />
</ModulePrefs>
<Content type="html"><![CDATA[
<html>
@kostia
kostia / upgrade-rails41-to-42-with-rspec2.md
Last active August 29, 2015 14:13
Upgrading Rails 4.1 to 4.2 with RSpec 2

Upgrading Rails 4.1 to 4.2 with RSpec 2

Upgrading Rails is normally a simple task, especially if the difference between the versions is not very large. But in the case of 4.1 to 4.2 upgrade of an application (or a library) using RSpec 2, it can get messy, because RSpec 2 is not fully compatible with Rails 4.2. So in order to upgrade Rails, you have to upgrade RSpec first. Here how we did that:

In order to upgrade to RSpec 3 we first upgrade to RSpec 2.99.0, run the specs to see the deprecations, fix the deprecations and then upgrade to 3.1.0.

  1. First remove all RSpec gems except rspec-rails (all the rspec-* gems).
  2. Then update rspec-rails gem to version 2.99.0.
// We could also copy this file with `rails g scrivito_editors:install`...
//= require scrivito_editors/binary_editor
//= require scrivito_editors/multienum_editor
//= require scrivito_minicolors_editor
(function() {
scrivit.on('content', function(content) {
if (scrivito.in_editing_view()) {
$(content).find('[data-scrivito-field-type=binary]').scrivito_binary_editor();
@kostia
kostia / en
Last active August 29, 2015 14:04
#!/usr/bin/env ruby
if %x{which termit}.empty?
puts 'Missing the "termit" command.'\
' Please install the corresponding gem.'\
' See https://github.com/pawurb/termit for details.'
exit 1
end
if ARGV.empty?
@kostia
kostia / git-open-pr
Last active August 29, 2015 14:03
Open Github-PR for a given SHA1 of a commit
#!/usr/bin/env bash
# Based on https://github.com/mhagger/git-when-merged.
# Usage: git open-pr <SHA1>
commit_sha1=`git when-merged $1|tr -s ' '|cut -d' ' -f2`
commit_pr_number=`git show $commit_sha1|grep 'Merge pull request'|cut -d'#' -f2|cut -d' ' -f1`
open "https://github.com/infopark/rails_connector/pull/$commit_pr_number"
@kostia
kostia / install.bash
Created April 14, 2014 23:25
Installation of jquery.li18n
bower install jquery.li18n
# Es gab insgesamt 4 Teilnehmer.
# Insgesamt 5 Lösungen.
# Davon 3 hatten richtige Ergebnisse.
#
# Lösungsansätze.
#
# Es gibt grundsätzlich 3 Lösungsansätze:
# 1. Iteration (Lösung 1, Lösung 2, Lösung 3). Einfach zu verstehen und zu implementieren.
# 2. "Divide and Conquer" mit Rekursion (Lösung 4).
                                                  
          [48
Defaults passwd_timeout = 0
@kostia
kostia / API.md
Last active August 29, 2015 13:57 — forked from ryaz/API.md

API

$.li18n.currentLocale = locale

Set the current locale.

Default is 'en'.

$.li18n.currentLocale = 'de';