Skip to content

Instantly share code, notes, and snippets.

@esfand
esfand / File1
Created March 19, 2010 09:11
This is the description of this Gist. It seems it can only be one line. So, this is in fact the NAME and not a description fo the Gist.
Embed All Files: <script src="http://gist.github.com/337370.js"></script>
Embed This File: <script src="http://gist.github.com/337370.js?file=gistfile1.txt"></script>
Another test. This time it is a public Gist.
@esfand
esfand / PrintValues
Created March 20, 2010 11:55
MSBuild Property Demo
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"
DefaultTargets="PrintValues"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Add>$([MSBuild]::Add(5,9))</Add>
<Subtract01>$([MSBuild]::Subtract(90,768))</Subtract01>
<Mult01>$([MSBuild]::Multiply(4,9))</Mult01>
<Div01>$([MSBuild]::Divide(100,5.2))</Div01>
@esfand
esfand / Sample.proj.xml
Created March 20, 2010 12:12
MSBuild Target Sample
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- This uses a .targets file to offload performing the build -->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)'=='' ">Release</Configuration>
<OutputPath Condition=" '$(OutputPath)'=='' ">$(MSBuildProjectDirectory)\BuildArtifacts\bin\</OutputPath>
</PropertyGroup>
@esfand
esfand / MSBuild Inline Task.proj.xml
Created March 20, 2010 12:32
MSBuild Inline Task
<?xml version="1.0" encoding="utf-8"?>
<!-- Sample Demonstrates Inline Tasks © 2010 Sayed Ibrahim Hashimi -->
<Project ToolsVersion="4.0"
DefaultTargets="Demo"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask
TaskName="CreateGuid02"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
@esfand
esfand / MSBuild Inline Task .xml
Created March 20, 2010 12:49
MSBuild Inline Task
<!-- Sample Demonstrates Inline Tasks © 2010 Sayed Ibrahim Hashimi -->
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"
DefaultTargets="Demo"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask
TaskName="FilterList"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
@esfand
esfand / MSBuild Batching 1.xml
Created March 20, 2010 13:10
MSBuild Batching
<?xml version="1.0" encoding="utf-8"?>
<!-- MSBuild Batching -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<fruit Include="apple">
<consistency>firm</consistency>
</fruit>
<fruit Include="orange">
<consistency>pulpy</consistency>
// Json (de)serializer for GWT.
// To work with JSON in GWT:
public class Customer extends JavaScriptObject {
public final native String getFirstName() /*-{
return this.first_name;
}-*/;
public final native void setFirstName(String value) /*-{
this.first_name = value;
}-*/;
package com.google.sitebricks.binding;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.servlet.SessionScoped;
import net.jcip.annotations.ThreadSafe;
import javax.servlet.http.HttpSession;
import java.io.Serializable;
import static org.appfuse.gwt.service.client.rest.RestConstants.*;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Header;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
/**
@esfand
esfand / EntryPointTemplte.gwt.java
Created March 28, 2010 06:44
GWT EntryPoint JSON RPc
package com.lingona.rockgwt.front.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;