Skip to content

Instantly share code, notes, and snippets.

View bovan's full-sized avatar

Børge Antonsen bovan

  • AKVA Group
  • Trondheim, Norway
View GitHub Profile
@bovan
bovan / wftestytesty.json
Created January 19, 2011 15:10
from itemfilewritestore
"identifier": "id",
"label": "name",
"items": [
{
"id": "0",
"name": "Root",
"children": {
"_reference": "dijit__TreeNode_9-dnd"
}
},
@bovan
bovan / IE6jQueryDropDown.html
Created December 1, 2010 09:30
read header
<!doctype html>
<html>
<head>
<title>IE6 test</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body {
font-size: 18px;
line-height: 2;
}
@bovan
bovan / ie-dropdownfix.js
Created November 30, 2010 14:13
small fix to enable dropdown in IE6.. does throw errors when there isn't any subitems (ul) inside though
if ($.browser.msie && $.browser.version.substr(0,1)<7) {
$('.nav > ul > li').live('mouseover mouseout', function(e) {
if($("ul", this)[0])
$("ul", this)[0].style.display = (e.type == 'mouseover')? 'block' : "none";
});
}
begin
namespace :db do
desc "Add some fake data to the database"
dateCounter = 1
task :populate => :environment do
5.times do
i = dateCounter.to_s()
date = "0"+i+".0"+i+".200"+i
Tut.create! :title => Forgery::LoremIpsum.sentence, :url => "http://"+Forgery::LoremIpsum.word, :date => Date.parse(date), :description => Forgery::LoremIpsum.paragraphs(3), :hits => 0
dateCounter += 1
@bovan
bovan / iftest.js
Created November 26, 2010 01:16
testing some if speeds
var time1 = new Date().getTime();
var test = false;
for(var i = 0; i < 100000;i++)
{
if(test) {
test = false;
} else {
test = true;
}
}
@bovan
bovan / wtfcheck.js
Created November 25, 2010 12:07
informative line #13
$(document.body)data('trafikk').each(function(index, value){ // some overkill shrinking
data[index].include = (((($.isArray(data[index].ActualCounties.String )) ? data[index].ActualCounties.String.join() : data[index].ActualCounties.string).indexOf(filter) >= 0) && (filter.length > 0));
<h1> Hallo </h1>
<div id="map_canvas" style="width: 400px; height: 600px"></div>
<script type="text/javascript">
/* Fetches a JSON file with the data */
/* stors it in jquery data and starts map when successful */
function fetchData(){
$.ajax({
type: "GET",
url: "/vegvesen/data",
@bovan
bovan / roundedClickableHeader.html
Created November 8, 2010 14:02
rounded clickable header, the clickable field aint rounded though :(
<!doctype html>
<html>
<head>
<title>clickable header</title>
<style type="text/css">
header, a, p { margin: 0; padding: 0;}
/* ******************************************************************* */
/* the header has a rounded border */
header {
margin: 0 auto;