Skip to content

Instantly share code, notes, and snippets.

View oyvindholmstad's full-sized avatar
🐶

Øyvind Holmstad oyvindholmstad

🐶
View GitHub Profile
@oyvindholmstad
oyvindholmstad / schema-generator.js
Last active September 21, 2018 06:54
BigQuery JSON schema generator in Javascript and Scala
/*
A script to generate a Google BigQuery-complient JSON-schema from a JSON object.
Make sure the JSON object is complete before generating, null values will be skipped.
References:
https://cloud.google.com/bigquery/docs/data
https://cloud.google.com/bigquery/docs/personsDataSchema.json
https://gist.github.com/igrigorik/83334277835625916cd6
... and a couple of visits to StackOverflow
@oyvindholmstad
oyvindholmstad / contentscript.js
Last active August 31, 2015 09:56
An example of a simple contentscript for a Chrome Extension.
function createToolBar(toolbarUrl, callback) {
var toolbar = $('<div>').attr("id", "oda-toolbar");
$('body').prepend(toolbar);
var url = chrome.extension.getURL(toolbarUrl);
$('#oda-toolbar').load(url, function() { callback();});
}
function setupSearchInput() {
$("input#odaSearch").keyup(function (e) {
@oyvindholmstad
oyvindholmstad / EmbeddedResourceManager.fs
Created May 8, 2014 07:09
Fsharp EmbeddedResourceManager
open System;
open System.IO;
open System.Reflection;
module EmbeddedResourceManager =
let assembly = Assembly.GetCallingAssembly()
let private GetCompleteResourceName ( resourceName: string) =
let matches =