Skip to content

Instantly share code, notes, and snippets.

@baluubas
baluubas / dotnotation.cs
Last active September 19, 2016 17:09
MongoDB driver with DocumentDB
using System;
using MongoDB.Bson;
using MongoDB.Driver;
namespace ConsoleApp1
{
public class Program
{
public static void Main(string[] args)
{
@baluubas
baluubas / UploadWorkouts.java
Created January 3, 2016 16:41
Uploading a workout to Google Fit
package com.anderspersson.mioji.Services.GoogleFit;
import android.app.IntentService;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.support.annotation.NonNull;
@baluubas
baluubas / gist:e10756755c114a067e75
Created May 4, 2014 09:02
MSPointerDown target is wrong (Windows Phone 8.0)
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, user-scalable=no">
<style type="text/css">
.pane {
top: 0;
right: 0;
bottom: 0;
left: 0;
@baluubas
baluubas / ClassFactory.js
Last active January 3, 2016 16:49
Javascript 'classes' with private, protected and public variables and functions. Properties can be inherited. Note that this is just a theoretical excerise, I'm not using this in production.
define(['Name'], function(Name) {
var knownNamespaces = {};
function createMember(member, namespace, prototype, access) {
var name = new Name();
namespace[member] = name;
Object.defineProperty(prototype, name, {
writable: true ,
value: access[member] });
}