Skip to content

Instantly share code, notes, and snippets.

View MadsBuus's full-sized avatar

Mads Buus MadsBuus

  • Denmark
View GitHub Profile
@MadsBuus
MadsBuus / user.css
Last active February 14, 2017 08:20
Tatoodo - Ad hoc restyling of google inbox
// 1. install browser plugin to support custom js/css (i.e. https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld)
// 2. create entry for inbox.google.com/u/0/ (first inbox)
// 3. paste below
.b4, .b4 .at {
background-color: #b40909;
}
.b4 .at::before {
box-shadow: inset -24px 0 12px -12px #b40909;
@MadsBuus
MadsBuus / lexino-test
Created April 22, 2014 14:08
LXN_SFS1962-0700_K1_P1
## 1. Inledning ##
Även om det inte uttryckligen framgår av ändamålsbestämmelsen förutsätter
Äarbetsmiljölagen att det sker en avvägning mot andra viktiga intressen och
Ärimligheten av behövliga insatser (se vidare [Blyme, Arbetsmiljölag [1977:1160]
Ä2 kap. 1 §][1] under rubriken 3.1. Avvägn kjahsdkas jdhing mot andra intressen, Lexino
Ä2013-01-01).
## 2. Rättsläget ##
@MadsBuus
MadsBuus / engine.rb goto_result
Created June 5, 2013 11:12
revised goto-strategy
def goto_result
return nil unless @goto_search and autolink_match?
options = { queries: autolink_query, sort: 'chunkno asc', rows: 100, fl: 'topid,docid,chunkno,docverstype,productkeys' }
hits = Solr::Chunk.find(options)
if hits.docs.empty?
hits = Solr::Chunk.find(options, :searchable)
end
chunks = hits.docs.sort_by { |d| [ Document::PREFERRED_DOCVERSTYPE_ORDER.index(d[:docverstype]), d[:chunkno].to_i ] }
uniq_documents = chunks.uniq { |c| c[:topid] }
# only return first if its the only one of its kind
@MadsBuus
MadsBuus / gist:5446038
Created April 23, 2013 18:19
part of strack trace for ruby-2.0.0p0 asset precompilation. Occurs randomly
[workspace] $ /home/kgonline/.rvm/gems/ruby-2.0.0-p0/bin/rake assets:precompile RAILS_GROUPS=assets RAILS_ENV=production
/home/kgonline/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/fileutils.rb:323: [BUG] Segmentation fault
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0095 p:---- s:0442 e:000441 CFUNC :mkdir
c:0094 p:0064 s:0438 e:000437 METHOD /home/kgonline/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/fileutils.rb:323
c:0093 p:0018 s:0433 e:000432 BLOCK /home/kgonline/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/fileutils.rb:298 [FINISH]
c:0092 p:---- s:0430 e:000429 CFUNC :reverse_each
c:0091 p:0084 s:0427 e:000426 BLOCK /home/kgonline/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/fileutils.rb:296 [FINISH]