Skip to content

Instantly share code, notes, and snippets.

View grudolf's full-sized avatar

Gregor Rudolf grudolf

  • Koper, Slovenia
View GitHub Profile
@grudolf
grudolf / Collectors.java
Created October 29, 2020 12:37
MinAndMax collector for Optaplanner constraint streams
import org.apache.commons.lang3.tuple.Pair;
import org.optaplanner.core.api.score.stream.uni.UniConstraintCollector;
import org.optaplanner.core.impl.score.stream.uni.DefaultUniConstraintCollector;
import java.util.Comparator;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.function.Function;
/**
@grudolf
grudolf / profiles.json
Last active January 31, 2020 10:05
Cygwin in Windows Terminal
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"profiles": {
"defaults": {
"fontFace": "Consolas",
"fontSize": 10
@grudolf
grudolf / go.java
Last active September 6, 2016 13:21
Capture java http, https traffic with Fiddler
/*
Fiddler: Tools -> Fiddler Options -> HTTPS:
- capture https connects, decrypt https traffic
- export root certificate to desktop
Create keystore with fiddler certificate:
mkdir keys
cd keys
@grudolf
grudolf / Android settings
Created September 20, 2014 16:11
OpenVPN on Ubuntu 12.04 with Shorewall for Android clients
OpenVPN for Android
===================
https://play.google.com/store/apps/details?id=de.blinkt.openvpn
Basic
#####
Pull settings - On
No local binding - not enabled
@grudolf
grudolf / TimingTest.cs
Created February 15, 2013 22:28
Compare SCOPE_IDENTITY() and OUTPUT clause
using System;
using System.Diagnostics;
using System.Linq;
using NPoco.Tests.Common;
using NUnit.Framework;
namespace NPoco.Tests
{
[TestFixture]
class TimingTest : BaseDBDecoratedTest
@grudolf
grudolf / music-nav.cs
Created August 2, 2012 10:58
Navigational properties
//LinqPad, C# program style, navigational properties
public class Musician {
public Musician() {
Songs = new List<Song>();
}
public int MusicianId {get; set;}
public string LastName {get; set;}
public List<Song> Songs {get; set;}
}
@grudolf
grudolf / README.markdown
Created July 18, 2012 13:28 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string