Skip to content

Instantly share code, notes, and snippets.

Avatar

Luis Delgado murdockcrc

View GitHub Profile
@murdockcrc
murdockcrc / serialization-experiment.cs
Last active Apr 1, 2019
Console app that uses MessagePack and GZIP compression for benchmarking purposes
View serialization-experiment.cs
using System;
using System.Text;
using MessagePack;
using System.IO.Compression;
using System.IO;
namespace compress
{
class Program
{
View gist:8d4147a6a6d6fb7ca867cbdfcd2eff45
### Keybase proof
I hereby claim:
* I am murdockcrc on github.
* I am murdockcrc (https://keybase.io/murdockcrc) on keybase.
* I have a public key ASA4-0FoUUxIu5r2--zOChdYInu6FPeV9m85wOJejeO3SAo
To claim this, I am signing this object:
@murdockcrc
murdockcrc / CosmosDataLoader.cs
Created May 29, 2017
CosmosDb TableAPI CSV Data Loader
View CosmosDataLoader.cs
namespace TableSBS
{
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using System.Linq;
using System.IO;
@murdockcrc
murdockcrc / EventHub.swift
Created Apr 9, 2016
Posts batched events to an Event Hub endpoint
View EventHub.swift
//
// Created by Luis Delgado on 4/5/16.
//
import Foundation
import Alamofire
class EventHub {
static let eventHubName = NSURL(string: "https://{yourNamespace}.servicebus.windows.net/{yourEventhubName}")!
static let publisherId = "{yourPublisherId}"
@murdockcrc
murdockcrc / docDBFactory.js
Created Aug 5, 2015
Factory to create multiple DocumentDB clients
View docDBFactory.js
var AzureDbHelper = require('./azureDbHelper.js'),
config = require('../config.js');
module.exports = (function DbHelperFactory(){
var postsCollectionHelper;
var fanPostsCollectionHelper;
var concertsCollectionHelper;
return{
getPostsHelper: function getPostsHelper(){
@murdockcrc
murdockcrc / azureDocDBHelper.js
Last active Aug 29, 2015
DocumentDB facade (wrapper)
View azureDocDBHelper.js
//Constructor
function AzureDbHelper(databaseName, collectionName){
var _this = this;
if(!this.database || !this.collection) {
readOrCreateDatabase(databaseName, function (error, database) {
if (error) {
//throw new Error(error);
return;
}
_this.database = database;
@murdockcrc
murdockcrc / singleton.js
Created Jul 29, 2015
NodeJS Singleton pattern
View singleton.js
exports = module.exports = (function () {
// Instance stores a reference to the Singleton
var instance;
function init() {
// Singleton
// Private methods and variables
return {
@murdockcrc
murdockcrc / documentdb_random.js
Last active Sep 28, 2018
DocumentDB stored procedure to retrieve a random document
View documentdb_random.js
/*
The MIT License (MIT)
Copyright (c) 2015 HdV Media GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
View gist:8f802d88f6f6a4c846f5
$('.bg-public').on('click', editBackground);
function initializeCropper(options){
var cropper = $(options.imageBox).cropbox(options);
var originalImgSrc = options.imgSrc;
$(options.fileInput).on('change', function(){
var reader = new FileReader();
reader.onload = function(e) {
options.imgSrc = e.target.result;
cropper = $(options.imageBox).cropbox(options);
View gist:396d752f6ba960b526f4
<div class="container-fluid profile-canopy">
<div class="row">
<div class="profile-canopy-bg bg-public">
<img alt src="http://i.imgur.com/Dbqggm5.jpg"/>
<button ng-show="isAuthor()" ng-click="editBackground()" type="button" class="btn btn-primary btn-lg btn-bg-edit">Edit</button>
</div>
<div class="canopy-bg-edit hidden">
<div class="profile-canopy-bg imageBox-bg">
<div class="action">
<input type="file" id="bg-file" style="float:left; width: 250px">
You can’t perform that action at this time.