Skip to content

Instantly share code, notes, and snippets.

import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "swagger-play2"
val appVersion = "1.0"
val appDependencies = Seq(
@ayush
ayush / play2_controller.scala
Created December 21, 2011 11:20
Play 2.0 Controller Parameters
val updateEmployeeInput = Form(
of(
"id" -> of[String],
"name" -> of[String],
"department" -> of[String],
"salary" -> of[String]
)
)
def updateEmployee() = Action { implicit request =>
@ayush
ayush / WordnikAudioPron.as
Created July 8, 2011 01:15
wordnik-as3-sdk audio prons
package
{
import com.wordnik.api.client.WordnikClient;
import com.wordnik.api.entity.ApiUserCredentials;
import com.wordnik.api.entity.Word;
import com.wordnik.api.entity.word.AudioFileInfo;
import com.wordnik.api.event.ApiClientEvent;
import com.wordnik.api.event.Response;
import flash.display.Sprite;
@ayush
ayush / wordnik-as3-sdk.trace.txt
Created July 8, 2011 00:57
Output of wordnik-as3-sdk Batch Call Sample @ https://gist.github.com/1070878
Definitions
- The condition of being free of restraints.
- Liberty of the person from slavery, detention, or oppression.
Examples
- The pivot, the medium of this construction of the personality, is working in freedom, in accordance with the natural wants of the inner life; thus _freedom in intellectual work_ is found to be the _basis of internal discipline_.
- You have been promised land and freedom, but the counter-revolution will profit by the anarchy called forth by the Bolsheviki, and will deprive you of land and freedom….
- British hens and stags pay a heavy price for the last night of freedom• Price for hen and stag nights soars to £100.25 per person • Alcohol accounts for a third of the total spend• 1 in 10 cheat on their partner during the last night of freedomBritish hen and stag revellers are paying an average of £100.25 per person to celebrate the last night of freedom, according to a new survey published today Tuesday 17 April 2007.
- 'freedom of the press' they consider on a par with _free
@ayush
ayush / Main.as
Created July 8, 2011 00:51
Sample usage of wordnik-as3-sdk Batch Call
package
{
import com.wordnik.api.batch.Batch;
import com.wordnik.api.batch.OpGetAudioInfo;
import com.wordnik.api.batch.OpGetDefinitions;
import com.wordnik.api.batch.OpGetExamples;
import com.wordnik.api.batch.OpGetFrequencyData;
import com.wordnik.api.batch.OpGetPronunciations;
import com.wordnik.api.batch.OpGetRelatedWords;
import com.wordnik.api.client.WordnikClient;
@ayush
ayush / gist:1016158
Created June 9, 2011 06:07
jquery-tmpl and ssp/velocity
<!- Rendered by ssp/velocity -->
${name}
<!- Rendered as HTML for use by jquery-tmpl -->
<%="${name}"%>
@ayush
ayush / musixlib.scala
Created May 29, 2011 10:28
Sample usage of musix-lib library
// instantiate the API
val api = new MusixMatch("YOUR_API_KEY")
// get artist lady gaga
val artists = api.findExactArtistsByName("lady gaga")
assert(artists.length > 0)
for (artist <- artists) {
println(artist)
}
@ayush
ayush / audio.js
Created May 26, 2011 17:39
html5 audio file playback
$('#some-div').html('<audio autoplay="autoplay"><source src="' + mp3url + '" /></audio>');
@ayush
ayush / build.xml
Created May 23, 2011 11:53
Scala, Ivy, Ant and ScalaTest: a simple library project build file
<?xml version="1.0"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="mylib" default="publish" basedir=".">
<property name="revision" value="0.1"/>
<property name="sources.dir" value="src/main/java"/>
<property name="docs.dir" value="docs"/>
<property name="core.lib.dir" value="lib/core"/>
<property name="base.build.dir" value="build"/>
<property name="build.dir" value="build/core-classes"/>
<property name="distrib.dir" value="build/distrib"/>
@ayush
ayush / ivy.xml
Created May 23, 2011 11:46
Scala, Ivy, Ant and ScalaTest: a simple library project - ivy dependency file
<ivy-module version="2.0">
<info organisation="com.glug" module="mylib"/>
<configurations>
<conf name="core" description="only provide core library"/>
<conf name="test" extends="core" visibility="private" description="for testing the library"/>
<conf name="scala-lang" visibility="private" description="scala compile and library"/>
</configurations>
<publications>