Skip to content

Instantly share code, notes, and snippets.

View felipeleusin's full-sized avatar

Felipe Leusin felipeleusin

View GitHub Profile
@felipeleusin
felipeleusin / Test.cs
Created February 15, 2015 21:14
RavenTestBase + UniqueConstraint
namespace RavenEmbeddedBundleTest
{
using System.ComponentModel.Composition.Hosting;
using Raven.Bundles.UniqueConstraints;
using Raven.Client.UniqueConstraints;
using Raven.Tests.Helpers;
using Xunit;
public class Test : RavenTestBase
{
### Keybase proof
I hereby claim:
* I am felipeleusin on github.
* I am felipe (https://keybase.io/felipe) on keybase.
* I have a public key whose fingerprint is 11C8 AA43 40C0 733C 0E54 8A5E 37B4 5CAF F74D 1E57
To claim this, I am signing this object:
@felipeleusin
felipeleusin / gist:6137ce52847883df63ce
Created June 25, 2014 16:19
RavenDB MultiGroup Index Error
public class Model
{
public string Id { get; set; }
public string Date { get; set; }
public string VenueId { get; set; }
public string UserId { get; set; }
@felipeleusin
felipeleusin / keybase.md
Created April 11, 2014 22:37
keybase.md

Keybase proof

I hereby claim:

  • I am felipe on github.
  • I am felipe (https://keybase.io/felipe) on keybase.
  • I have a public key whose fingerprint is 209C DE08 6315 2647 3954 B5FA D0F8 1F05 B476 7B66

To claim this, I am signing this object:

@felipeleusin
felipeleusin / Error Message
Created February 6, 2014 15:35
Error when deploying from git with custom deployment (Azure US East)
Command: deploy.cmd
Installing Kudu Sync
An error has occured during web site deployment.
Installing Kudu Sync
An error has occured during web site deployment.
D:\Program Files (x86)\SiteExtensions\Kudu\1.25.30110.617\bin\scripts\starter.cmd deploy.cmd
@felipeleusin
felipeleusin / instrunctions.md
Last active January 2, 2016 23:29
SmartPolicing Server Configuration

Instructions for utilisation of the SmartPolicing Platform

The project (codenamed Mogi) consists of two pieces: an Application Server and a Android application.

The server is split in three modules: the NodeJS application, the HTML administrative interface and the streaming server. The ideal setup is to setup a Linux (Ubuntu or CentOS were the distribution testeds) with a NGINX server, the NGINX will the handle serving the administrative interface assets to a specific folder and relay the other requests to the NodeJS application.

An example nginx.conf file is as follow:

location /admin { alias /PATH_TO_ADMIN_DIST_FOLDER/

@felipeleusin
felipeleusin / gist:5961320
Last active December 19, 2015 13:19
Nancy reduce ModelBinding Logic
public class TestModule : NancyModule
{
public TestModule()
{
Post["/"] = WithModelValidated<Input>( (p,model) =>
{
return model.Email;
});
}
@felipeleusin
felipeleusin / gist:5872248
Created June 26, 2013 22:19
Get hash android application is running. Paste this on OnCreate of any activity and run.
try {
PackageInfo info = getPackageManager().getPackageInfo("com.dojoapps.miyagi",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("YOURHASH KEY:",
Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (PackageManager.NameNotFoundException e) {
@felipeleusin
felipeleusin / gist:5765481
Created June 12, 2013 13:54
Deploy when solution has multiple projects and to run tests
@echo off
:: ----------------------
:: KUDU Deployment Script
:: ----------------------
:: Prerequisites
:: -------------
:: Verify node.js installed
@felipeleusin
felipeleusin / gist:5754084
Created June 11, 2013 02:17
Mute Android devices
AudioManager mgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
int streamType = AudioManager.STREAM_SYSTEM;
mgr.setStreamSolo(streamType, true);
mgr.setRingerMode(AudioManager.RINGER_MODE_SILENT);
mgr.setStreamMute(streamType, true);