Skip to content

Instantly share code, notes, and snippets.

View Makesh's full-sized avatar

Makesh Kumar Karpagavinayagam Makesh

View GitHub Profile
export PGPASSWORD=password
/Library/PostgreSQL/9.4/bin/psql -U postgres -f /Users/makesh/Documents/Workspace/medex/database/dbdrop.sql
echo "re-create database .. "
/Library/PostgreSQL/9.4/bin/psql -U postgres -f /Users/makesh/Documents/Workspace/medex/database/dbcreate.sql
echo "run dll database .. "
/Library/PostgreSQL/9.4/bin/psql -U postgres -d medx -f /Users/makesh/Documents/Workspace/medex/database/ddl.sql
echo "re-create procedures in database .. "
/Library/PostgreSQL/9.4/bin/psql -U postgres -d medx -f /Users/makesh/Documents/Workspace/medex/database/procedure.sql
------------------ Pre Java 8 ---------------------
Map<Employee, File> fileMap = new HashMap<Employee, File>();
int i =0;
for (Map.Entry<Employee, File> entry : map.entrySet()) {
i++;
// do something with i
}
------------------ Java 8 Lambda ---------------------
AtomicInteger counter = new AtomicInteger(0);
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
#!/bin/bash
echo 'Starting tomcat'
export JPDA_ADDRESS=8000
export JPDA_TRANSPORT=dt_socket
/Users/xyz/Documents/Tools/apache-tomcat-8.0.15/bin/catalina.sh jpda start
@Makesh
Makesh / gist:406c56bd064024a84e09
Last active March 3, 2016 04:41
Java 8 : Read
String jsonContent = null;
String url = '/Users/makesh/temp/temp.json'
try {
jsonContent = new String(Files.readAllBytes(Paths.get(url)));
} catch (IOException e) {
logger.error(e.getMessage());
}
@GET
@Path("/cars")
@Produces(MediaType.APPLICATION_JSON)
public Car[] getCars() {
...
}
@Makesh
Makesh / gist:2503421
Created April 26, 2012 21:42
convert eclipse project into Android project
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>androidtest</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>