Skip to content

Instantly share code, notes, and snippets.

View sandrinodimattia's full-sized avatar
🏠
Working from home

Sandrino Di Mattia sandrinodimattia

🏠
Working from home
View GitHub Profile
@sandrinodimattia
sandrinodimattia / gist:3162266
Created July 23, 2012 06:21
GoogleReader Service
public class ReaderService : GoogleService
{
/// <summary>
/// Current username.
/// </summary>
private string username;
/// <summary>
/// Initialize the Google reader.
/// </summary>
@sandrinodimattia
sandrinodimattia / gist:3162267
Created July 23, 2012 06:22
GoogleReader sample
class Program
{
static void Main(string[] args)
{
// Empty line.
Console.WriteLine("");
// Get username.
Console.Write(" Enter your Google username: ");
string username = Console.ReadLine();
@sandrinodimattia
sandrinodimattia / gist:3162283
Created July 23, 2012 06:29
Client Access Policy
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="http://*" />
<domain uri="https://*" />
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
@sandrinodimattia
sandrinodimattia / gist:3162286
Created July 23, 2012 06:29
AAR Reverse Proxy
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<rewrite>
<rules>
<rule name="Reverse Proxy to Business Logic Tier" stopProcessing="true">
<match url="^riaservices/(.*)" />
@sandrinodimattia
sandrinodimattia / gist:3162296
Created July 23, 2012 06:36
Dynamics CRM query ContactSet
var contacts = from c in context.ContactSet
                where c.FirstName == "Sandrino"
                select c;
 
foreach (var contact in contacts)
{
    Console.WriteLine(contact.FullName);
}
@sandrinodimattia
sandrinodimattia / gist:3162298
Created July 23, 2012 06:37
app.config Proxy Settings
<?xml version="1.0"?>
<configuration>
  <system.net>
    <defaultProxy enabled="true" useDefaultCredentials="true"/>
  </system.net>
</configuration>
@sandrinodimattia
sandrinodimattia / gist:3162299
Created July 23, 2012 06:37
Dynamics CRM 2011 Trace Error
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error">
<TraceIdentifier>http://msdn.microsoft.com/nl-BE/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier>
<Description>Throwing an exception.</Description>
<AppDomain>/LM/W3SVC/2/ROOT-1-129423140458251760</AppDomain>
<Exception>
<ExceptionType>System.ComponentModel.Win32Exception, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>The Security Support Provider Interface (SSPI) negotiation failed.</Message>
<StackTrace>
at System.ServiceModel.Security.WindowsSspiNegotiation.GetOutgoingBlob(Byte[] incomingBlob, ChannelBinding channelbinding, ExtendedProtectionPolicy protectionPolicy)
> at System.ServiceModel.Security.SspiNegotiationTokenAuthenticator.ProcessNegotiation(SspiNegotiationTokenAuthenticatorState negotiationState, Message incomingMessage, BinaryNegotiation incomingNego)>
@sandrinodimattia
sandrinodimattia / gist:3162303
Created July 23, 2012 06:41
eID MW sample application
try
{
BEID_ReaderSet readerSet = BEID_ReaderSet.instance();
BEID_ReaderContext reader = readerSet.getReader();
if (reader.isCardPresent())
{
BEID_EIDCard card = reader.getEIDCard();
BEID_EId doc = card.getID();
@sandrinodimattia
sandrinodimattia / gist:3162307
Created July 23, 2012 06:43
eID MW warning level
void APL_EIDCard::askWarningLevel()
{
APL_AccessWarningLevel lWarningLevel=getWarningLevel();
if(lWarningLevel==APL_ACCESSWARNINGLEVEL_REFUSED)
throw CMWEXCEPTION(EIDMW_ERR_NOT_ALLOW_BY_USER);
if(lWarningLevel==APL_ACCESSWARNINGLEVEL_BEING_ASKED)
throw CMWEXCEPTION(EIDMW_ERR_USER_MUST_ANSWER);
<?xml version="1.0" encoding="utf-8"?>
<jnlp codebase="https://localhost:100/" href="beid.jnlp">
  <information>
    <title>Java Binding to Belgium eID Middleware 3.5</title>
    <vendor>Fedict</vendor>
    <offline-allowed/>
  </information>
  <security>
      <all-permissions/>
  </security>