Skip to content

Instantly share code, notes, and snippets.

View kostia's full-sized avatar

Kostia Newt kostia

  • JustRelate
  • Berlin, Germany
View GitHub Profile
@kostia
kostia / gist:9079278
Last active August 29, 2015 13:56
Re: 5 surprisingly painful things about client-side JS

Bad search ranking and Twitter/Facebook previews

  • Google & Co. should be feeded with https://prerender.io/
  • Facebook and Twitter should be feeded with extra content. Always. And it's easy to implement.

Flaky stats and monitoring

Dunno...

Slow, complex build tools

# Bad, because declarative code without business logic should NOT be absolutely DRY.
%w[Bob Alice].each do |first_name|
%w[Black White].each do |second_name|
Person.create(first_name: first_name, second_name: second_name)
end
end
# Good, because it's clear, what results the code produces. Declarative, baby!
# Not perfect, because the naming of the params is
@kostia
kostia / API.md
Last active August 29, 2015 13:57 — forked from ryaz/API.md

API

$.li18n.currentLocale = 'xxx';
Set the current locale.

Default is "en".

@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';
Defaults passwd_timeout = 0
                                                  
          [48
# 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).
@kostia
kostia / install.bash
Created April 14, 2014 23:25
Installation of jquery.li18n
bower install jquery.li18n
@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 / 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?