Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am heim on github.
  • I am heimunacast (https://keybase.io/heimunacast) on keybase.
  • I have a public key ASAf7FlWC-Kv1C2tUlo71Eid8_ExC9QUzBtGSFMtQzaVfwo

To claim this, I am signing this object:

@heim
heim / nosql-roadshow.md
Created December 6, 2012 15:25
Notater fra NoSQL roadshow

NoSQL RoadShow 2012

  • Considerations for using nosql at your next it project "Akmal B. Chaudry - IBM"
    • Finding relevant developer skills
    • choosing the right product
    • crossing the chasm
      • great open source community
      • backed by commercial companies
  • history
define(["moment"], function(moment) {
function PrognosisTimeKeeper(prognosisTime) {
var initialPrognosisTime = function() {
//this == Window
var currentTime = moment(this.lastPrognosisTime, "DD.MM.YYYY HH:MM");
return currentTime.add("h", 4).format("YYYY-MM-DD HH\\0\\0");
};
var setNewPrognosisTime = function() {
this.lastPrognosisTime = prognosisTime.get("lastPrognosisProductionTime");
};
@heim
heim / repo-size.sh
Created September 11, 2012 19:17
repo-size.sh
#!/bin/bash
set -e
function main() {
git rev-list --reverse --since="6 months ago" HEAD |
while read rev; do
echo "`revision_time`, `line_count`"
done
}
say "Rim me up, before you go go. rapapapapapa bappbappbapp.......... BANG"
@heim
heim / IkkeEnTest.java
Created December 19, 2011 13:26
Ikke en test
public void testSave() {
Currency currency = new Currency();
_templateMock.expects(once()).method("merge").with(same(currency));
_currencyDAO.save(currency);
}
@heim
heim / gist:1354699
Created November 10, 2011 12:01
Groovy jdbc-template shit
import org.junit.Test
import javax.sql.DataSource
import org.apache.commons.dbcp.BasicDataSource
import static junit.framework.Assert.assertNotNull
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate
import org.springframework.jdbc.core.RowMapper
import java.sql.ResultSet
import org.joda.time.LocalDate
private void updateTerm() {
if (_orderComponent.getOrder().getPrint().getEdition().getCalculationType() == Edition.COMPENSATION) {
String[] props = { "price", "currency", "unit", "maxCount", "validUntil", "deadline", "recived", "permanent", "status" };
PropertyUtils.copyProperties(_orderComponent.getTerm(), _term, props);
if (_term.getExternalInvoice() != null && !_term.getExternalInvoice().getAmountString().equals("")) {
float amount = FloatUtil.stringToFloat(_term.getExternalInvoice().getAmountString());
_term.getExternalInvoice().setAmount(amount);
_orderComponent.getTerm().setExternalInvoice(_term.getExternalInvoice());
} else {
require 'vagrant'
task :hello do
env = Vagrant::Environment.new
raise "Must run `vagrant up`" if !env.primary_vm.created?
raise "Must be running!" if !env.primary_vm.vm.running?
env.primary_vm.ssh.execute do |ssh|
ssh.exec!("echo 'Hello BuyPass' > hello.txt")
end
We couldn’t find that file to show.