Skip to content

Instantly share code, notes, and snippets.

Makesh Kumar Karpagavinayagam Makesh

Block or report user

Report or block Makesh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View PGPASSWORD
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
View Increment counter in lambda functions
------------------ 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);
View source-1.8
<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>
View start tomcat in debug mode
#!/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
View gist:406c56bd064024a84e09
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());
}
View gist:2631338
@GET
@Path("/cars")
@Produces(MediaType.APPLICATION_JSON)
public Car[] getCars() {
...
}
@Makesh
Makesh / gist:2503421
Created Apr 26, 2012
convert eclipse project into Android project
View gist:2503421
<?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>
You can’t perform that action at this time.