Skip to content

Instantly share code, notes, and snippets.

@sachin-handiekar
sachin-handiekar / sample.yml
Created March 15, 2016 13:08
Installing custom cmake on Travis CI
install:
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
fi
@sachin-handiekar
sachin-handiekar / .travis.yml
Created March 13, 2016 12:55
C++ Sample travis.yml file
sudo: required
before_install:
- sudo apt-get install libao-dev
- sudo apt-get install libcurl4-openssl-dev
- chmod +x installMPG123.sh
- ./installMPG123.sh
# Enable C++ support
language: cpp
@sachin-handiekar
sachin-handiekar / OneLinePrintSystemProp.java
Created January 13, 2016 14:26
Printing System Properties
System.getProperties().list(System.out);
@SuppressWarnings("PMD.ReplaceHashtableWithMap")
public Hashtable getDetails() {
// code goes here
}
// HTTP
System.setProperty("http.proxyHost", "proxyHost.com");
System.setProperty("http.proxyPort", "80");
//HTTPS
System.setProperty("https.proxyHost", "proxyHost.com");
System.setProperty("https.proxyPort", "80");
<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.sachinhandiekar.example</groupId>
<artifactId>SimpleWS</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<cxf.version>2.6.0.redhat-60024</cxf.version>
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0" xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0">
<jaxws:endpoint id="HelloWorldServiceEndpoint"
implementor="#helloWorldService" address="/HelloWorldService" />
<bean id="helloWorldService"
class="com.sachinhandiekar.example.webservice.HelloWorldService" />
package com.sachinhandiekar.example.webservice;
import javax.jws.WebService;
@WebService(endpointInterface = "com.sachinhandiekar.example.webservice.HelloWorld")
public class HelloWorldService implements HelloWorld {
public String sayHello(String name) throws Exception {
return "Hello " + name;
}
@sachin-handiekar
sachin-handiekar / reverse-number.c
Created December 30, 2015 14:34
Reverse a number in C
#include <stdio.h>
int main(void) {
int number, temp;
int reverseNumber = 0;
printf("Enter your number : \n");
scanf("%i", &number);
while (number != 0) {
cov-configure --java
cov-build --dir ./cov-int mvn -Dmaven.compiler.fork=true \
-Dmaven.compiler.forceJavaCompilerUse=true \
-Dmaven.test.skip=true \
-DskipTests \
clean verify