Skip to content

Instantly share code, notes, and snippets.

View rfaisal's full-sized avatar

Faisal Rahman rfaisal

  • Facebook
  • Vancouver, BC
View GitHub Profile
config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html"));
var _url = 'http://localhost:49811/'; // the api root url
var _sample_greeting = 'Hey, there!'; // a sample greeting
//get all, sample JSON response: [{"id":1,"content":"Hey!"},{"id":2,"content":"Morning!"}]
$.ajax({type: "GET", url: _url + 'api/greetings', success: function (_d) {/*do stuff with _d*/});
//create new
$.ajax({type: "POST", url: _url + 'api/greetings/', data: {'':_sample_greeting}});
//update the 1st greeting
$.ajax({type: "PUT", url: _url + 'api/greetings/?id=1', data: {'':_sample_greeting}});
//delete the 1st greeting
$.ajax({type: "DELETE", url: _url + 'api/greetings/?id=1'});
android
android create avd --name Default --target 2 --abi armeabi-v7a
@rfaisal
rfaisal / mvn.sh
Last active August 29, 2015 13:56
mvn --version
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.skeleton</groupId>
<artifactId>skeleton</artifactId>
<version>0.1.0</version>
<packaging>apk</packaging>
mvn clean package
mvn android:emulator-start
mvn android:deploy android:run
public class Greeting {
private int id;
private String content;
//getters and setters for id and content
}