Skip to content

Instantly share code, notes, and snippets.

View ngiger's full-sized avatar

Niklaus Giger ngiger

View GitHub Profile
{ pkgs, lib, inputs, ... }:
{
# https://devenv.sh/basics/
env.GREET = "devenv";
# https://devenv.sh/packages/
packages = with pkgs; [ git lyx hunspell hunspellDicts.de_CH hunspellDicts.fr-any hunspellDicts.en_US gimp scribus scribus typst pandoc gist];
enterShell = ''
git --version
'';
#!/bin/sh
#
# Postgresql backup script
# http://www.bitweaver.org/wiki/pg_backup+PostgreSQL+backup+script
#
# Author
# |
# +-- speedboy (speedboy_420 at hotmail dot com)
# +-- spiderr (spiderr at bitweaver dot org)
# +-- flexiondotorg (code at flexion dot org)
@ngiger
ngiger / settings.xml
Last active August 29, 2015 13:56
recommended settings.xml for elexis 3 maven
<?xml version="1.0" encoding="UTF-8"?>
<!-- this file should be saved as ~/.m2/settings.xml -->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>elexis</activeProfile>
</activeProfiles>
<profiles>
<profile>
@ngiger
ngiger / remove_legacy.rb
Created December 3, 2013 08:11
Example of Ruby script iterating over all *.rb files and deleting lines matching a certain pattern
#!/usr/bin/env ruby
files = Dir.glob("**/*.rb")
files.each{
|file|
next if File.expand_path(file) == File.expand_path(__FILE__)
content = IO.readlines(file)
content.delete_if {|x| /LEGACY_INTERFACE = false/.match(x) }
File.open(file, 'w+'){|out| out.write(content.join()) }
}
@ngiger
ngiger / elexis_2_to_3.rb
Last active December 30, 2015 01:49
A small helper to convert Elexis plugins from 2.1.7 to Elexis 3.0
#!/usr/bin/env ruby
# A small helper to convert Elexis plugins from 2.1.7 to Elexis 3.0
# Copyright 2013 by Niklaus Giger <[email protected]>
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the License.
@ngiger
ngiger / gist:5754964
Created June 11, 2013 07:08
import_daily finishes. Don't know whether this is an error or not
/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:342:in `block in odba_replace_stubs': method `method_missing' called on hidden T_HASH object (0x000000445e4090 flags=0x8 klass=0x0) (NotImplementedError)
from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:340:in `each'
from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:340:in `odba_replace_stubs'
from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:52:in `odba_receiver'
from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
from /var/www/oddb.org/src/plugin/swissmedic.rb:363:in `block in mail_notifications'
from /var/www/oddb.org/src/plugin/swissmedic.rb:361:in `each'
from /var/www/oddb.org/src/plugin/swissmedic.rb:361:in `inject'
from /var/www/oddb.org/src/plugin/swissmedic.rb:361:in `mail_notifications'
from /var/www/oddb.org/src/util/exporter.rb:432:in `
@ngiger
ngiger / export_patents_2013_06_10.txt
Created June 11, 2013 06:54
Results of daily_import of ywesee June 10 2013
From [email protected] Mon Jun 10 23:02:20 2013
Return-Path: <[email protected]>
Received: from edge04.upcmail.net ([192.168.13.239])
by viefep20-int.chello.at
(InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP
id <20130610205956.OGCI7353.viefep20-int.chello.at@edge04.upcmail.net>
for <[email protected]>; Mon, 10 Jun 2013 22:59:56 +0200
Received: from ywesee.com ([84.73.49.252])
by edge04.upcmail.net with edge
id mkzv1l00q5SUNM803kzvya; Mon, 10 Jun 2013 22:59:56 +0200