Skip to content

Instantly share code, notes, and snippets.

View khebbie's full-sized avatar

Klaus Hebsgaard khebbie

View GitHub Profile
//Note: This command was automatically generated by the create-new-search-command command.
CmdUtils.CreateCommand({
name: "dba.dk",
url: "http://www.dba.dk//asp/soegning/soegning.asp",
icon: "http://www.dba.dk/favicon.ico",
description: "Søger nyt og brugt, køb og salg på dba.dk",
takes: {"search term": noun_arb_text},
execute: function(input){ var query = encodeURIComponent(input.text);
var postData = "niveau=&kortsogX=0&kortsogY=0&radX=0&radY=0&kortsogRad=0&kortsogNavn=0&rubrikId=&Sortering=&Sorteringtype=&KunKoebNuPris=&Sortsearch=&Annoncetype=&AnnoncetypeRange=7&Fritekst={QUERY}&PrisFra=0&PrisTil=9999999".replace(/%s|{QUERY}/g, query);
Utils.openUrlInBrowser("http://www.dba.dk//asp/soegning/soegning.asp", postData);}
@khebbie
khebbie / My first stab at flexmock.rb
Created March 28, 2010 17:00
My first stab at flexmock
require 'rubygems'
require 'flexmock/test_unit'
class Dog
def initialize(tail)
@tail = tail
end
def IsHappy?
if(@tail.wag)
@khebbie
khebbie / gist:721980
Created November 30, 2010 17:01
First try at doing DynamicTable
//First the usage
//Would be cool to use it for taking out parameters from a table, when I only use a few parameters and don't have a real class
[Given(@"the following Dealer exists")]
public void GivenTheFollowingDealerExists(DynamicSpecflowTable dynamicTable )
{
string Id = Convert.ToInt32(dynamicTable.FirstRow().Id);
string Name = dynamicTable.FirstRow().Name;
// do your stuff
@khebbie
khebbie / gist:1096819
Created July 21, 2011 09:03
automatisering af klikspillet i sommer summarum
require 'watir-webdriver'
b = Watir::Browser.new(:chrome)
b.goto "http://77.66.32.235/oline/totalclicks_010711/test_todb.php"
b.button(:name, "send").wait_until_present
200000.times {
b.button(:name, "send").click}
@khebbie
khebbie / IronJS in LinqPad
Created October 1, 2011 19:08
Please add a reference to the IronJS.dll (the x86 version) to make it work
void Main()
{
var script = @"
var NumeralConverter = {
get_arabic_numeral : function ( romanNumeral ){
return 1;
}
}
var x = function(input) {
print('From within javascript function');
@khebbie
khebbie / IronJs with Massive in LinqPad.cs
Created October 4, 2011 13:42
IronJs with Massive in LinqPad
void Main()
{
var connectionString = @"Data Source=.\SQLExpress;Integrated Security=true; ;initial catalog=MassiveTest;";
var tbl = new DynamicModel(connectionString);
var ctx = new IronJS.Hosting.CSharp.Context();
ctx.SetGlobal("query", IronJS.Native.Utils.CreateFunction<Func<string, IEnumerable<dynamic>>>(ctx.Environment, 1, tbl.Query));
var script = @"
query('select top 1 * from Person')
";
@khebbie
khebbie / paradoxes in religion.md
Last active September 28, 2015 21:49
Paradoxes in religion.

If a god, exists he/she/it must be greater than any human.

The definition of 'greater' could be many things, but I choose to define it in a measure of "thought-space". Thought-space would be something like what you are able to keep in your thoughts, and understand - so its so much more than IQ...

Many people state that "if I can not understand god, then I will not believe him/she/it".

But implicit in this you thereby state that you do not believe in any god, since he/she/it must be greater than you, and hence something you wont understand completely.

This also leads to the fact that paradoxes MUST exists in religion or it is not a religion involving a real god.

@khebbie
khebbie / forældreintra.js
Created March 12, 2012 18:53
Small tampermonkey script to handle the width of forældreintra
var jq = document.createElement('script');
jq.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js';
document.getElementsByTagName('head')[0].appendChild(jq);
$('frameset').first().attr('cols', '*, 1, 1500,1,*')
@khebbie
khebbie / What kids should know about computers.md
Last active October 8, 2015 06:58
What kids should know about computers

I would consider using a Raspberry PI for this since it is created for this very purpose

What is a computer?

  • CPU
  • RAM
  • Harddisk

What is an operating system?

We couldn’t find that file to show.