Skip to content

Instantly share code, notes, and snippets.

View yavuztas's full-sized avatar
🏠
Working from home

Yavuz Tas yavuztas

🏠
Working from home
View GitHub Profile
public static Set<Integer> toSet(int[] array) {
return Arrays.stream(array).boxed().collect(Collectors.toSet());
}
public static Set<Long> toSet(long[] array) {
return Arrays.stream(array).boxed().collect(Collectors.toSet());
}
public static Set<Double> toSet(double[] array) {
return Arrays.stream(array).boxed().collect(Collectors.toSet());
}
public static List<Integer> toList(int[] array) {
return Arrays.stream(array).boxed().collect(Collectors.toList());
}
public static List<Long> toList(long[] array) {
return Arrays.stream(array).boxed().collect(Collectors.toList());
}
public static List<Double> toList(double[] array) {
return Arrays.stream(array).boxed().collect(Collectors.toList());
}
int[] intArray = new int[] { 1, 2, 3 };
UtilsForCollections.toList(intArray); // gives us a compile error!
public static <T> Set<T> toSet(T[] array) {
return Arrays.stream(array).collect(Collectors.toSet());
}
public static <T> List<T> toList(T[] array) {
return Arrays.stream(array).collect(Collectors.toList());
}
public static <T> List<T> toList(T[] array) {
// TODO implement but how?
}
public class UtilsForCollections {
private UtilsForCollections() {
}
}
public class UtilsForCollections {
}
# only if you do not add the original repository as upstream
git remote add upstream https://github.com/original_github_username/original_github_repo_name.git
# then fetch and create a new branch for your pr
git fetch --all
git checkout -b new-branch-name-for-pr upstream/master
# pick the commits you want to include in your pr
git cherry-pick a52afa1
git cherry-pick 08f39f7
@yavuztas
yavuztas / gulpfile.js
Last active January 12, 2019 19:21 — forked from klugjo/gulpfile.js
Basic gulpfile.js for serve static files for gulp version 4+
// Add our dependencies
var gulp = require('gulp'), // Main Gulp module
concat = require('gulp-concat'), // Gulp File concatenation plugin
open = require('gulp-open'), // Gulp browser opening plugin
connect = require('gulp-connect'); // Gulp Web server runner plugin
// Configuration
var configuration = {
paths: {