Skip to content

Instantly share code, notes, and snippets.

View krosenvold's full-sized avatar

Kristian Rosenvold krosenvold

  • Zenior AS
  • Oslo, Norway
View GitHub Profile
@kdonald
kdonald / JsonNodeRowMapper.java
Created March 20, 2012 16:35
Auto Mapping a JDBC ResultSet to JSON
// convenient Spring JDBC RowMapper for when you want the flexibility of Jackson's TreeModel API
// Note: Jackson can also serialize standard Java Collections (Maps and Lists) to JSON: if you don't need JsonNode,
// it's simpler and more portable to have Spring JDBC simply return a Map or List<Map>.
package org.springframework.jdbc.core;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
@jarib
jarib / focus_test.rb
Created August 18, 2011 11:37
focus/blur in single display
require 'selenium-webdriver'
browser1 = Selenium::WebDriver.for :firefox
browser2 = Selenium::WebDriver.for :firefox # steals focus
begin
url = "data:text/html;content-type=utf-8,#{URI.escape DATA.read}"
browser1.get url
browser2.get url
@lenary
lenary / gitconfig.ini
Created February 18, 2011 01:21
a special excerpt of my gitconfig
$ git clone github:lenary/guides.git
Cloning into guides...
remote: Counting objects: 255, done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 255 (delta 111), reused 163 (delta 35)
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done.
Resolving deltas: 100% (111/111), done.
$ cd guides
$ git remote -v