Skip to content

Instantly share code, notes, and snippets.

View maciejwalkowiak's full-sized avatar

Maciej Walkowiak maciejwalkowiak

View GitHub Profile
#!/bin/bash
git clone [email protected]:tomitribe/simple-microservice.git &&
cd simple-microservice &&
mvn clean install &&
java -jar target/microservice-1.1.0-SNAPSHOT.jar
@dant3
dant3 / mvncolor.sh
Last active January 9, 2017 04:57 — forked from katta/mvncolor.sh
#!/usr/bin/env bash
# Formatting constants
BOLD=`tput bold`
UNDERLINE_ON=`tput smul`
UNDERLINE_OFF=`tput rmul`
TEXT_BLACK=`tput setaf 0`
TEXT_RED=`tput setaf 1`
TEXT_GREEN=`tput setaf 2`
TEXT_YELLOW=`tput setaf 3`
@chrisdarroch
chrisdarroch / idea
Created October 17, 2013 03:40
Open a project in IntelliJ IDEA from your command line!
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`
@esycat
esycat / PrettyPrinter.groovy
Last active November 5, 2024 13:54
A simple way to pretty print nested lists and maps in Groovy.
import static groovy.json.JsonOutput.*
def config = ['test': 'lalala']
println prettyPrint(toJson(config))
@Daniel15
Daniel15 / 1_README.md
Last active March 22, 2025 04:24
Complete Google Drive File Picker example

Google Drive File Picker Example

This is an example of how to use the Google Drive file picker and Google Drive API to retrieve files from Google Drive using pure JavaScript. At the time of writing (14th July 2013), Google have good examples for using these two APIs separately, but no documentation on using them together.

Note that this is just sample code, designed to be concise to demonstrate the API. In a production environment, you should include more error handling.

See a demo at http://stuff.dan.cx/js/filepicker/google/

@jkuipers
jkuipers / formMacros.ftl
Last active June 21, 2022 13:43
FreeMarker macros for rendering Bootstrap horizontal form inputs in Spring-MVC applications
<#ftl strip_whitespace=true>
<#import "spring.ftl" as spring />
<#-- This file contains form-related macros for use in the other Freemarker template files.
The generated HTML is intended for use with Twitter Bootstrap based forms. -->
<#--
* radioButtons
*
* @param path the name of the field to bind to
@conorbranagan
conorbranagan / gist:4513828
Last active August 16, 2024 14:06
Linux System Metrics

Linux System Metrics

CPU

  • system.cpu.idle: % Idle CPU
  • system.cpu.system: % System CPU
  • system.cpu.user: % User CPU

Disk

@agentgt
agentgt / ExampleController.java
Last active December 27, 2022 00:37
Spring Immutable Object Web Data Binding
public class ExampleController {
@RequestMapping(value = {"/blah", ""})
public @ResponseBody Map<String, Object> blah(@Valid Blah blah, BindingResult errors, ModelMap model) {
if (errors.hasErrors()) {
return ModelUtils.mapBuilder().put("status", "errors").build();
}
return ModelUtils.mapBuilder().put("status", blah.getFirst() + " " + blah.getLast()).build();
}
public static class Blah {
@chbaranowski
chbaranowski / JUnitEnclosedParameterizedTest.java
Created October 2, 2012 07:15
JUnitEnclosedParameterizedTest Demo
import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
@madan712
madan712 / ImageCropper.java
Created September 2, 2012 17:46
Java - Simple image cropping example
/* ImageCropper.java */
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public class ImageCropper {