Skip to content

Instantly share code, notes, and snippets.

View lovejavaee's full-sized avatar
👋
Java | C++ | Python | ML | DL

Jeff M lovejavaee

👋
Java | C++ | Python | ML | DL
View GitHub Profile
@lovejavaee
lovejavaee / gist:84bafbd4c6e87418718ab63029dc4e33
Created June 6, 2018 16:11 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@lovejavaee
lovejavaee / CustomResponseEntityExceptionHandler.java
Created July 24, 2017 09:03 — forked from matsev/CustomResponseEntityExceptionHandler.java
Generic response error handling using @ControllerAdvice
@ControllerAdvice
public class CustomResponseEntityExceptionHandler extends ResponseEntityExceptionHandler {
@Override
protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatus status, WebRequest request) {
List<FieldError> fieldErrors = ex.getBindingResult().getFieldErrors();
List<ObjectError> globalErrors = ex.getBindingResult().getGlobalErrors();
List<String> errors = new ArrayList<>(fieldErrors.size() + globalErrors.size());
String error;
for (FieldError fieldError : fieldErrors) {
#!/usr/bin/env python
from __future__ import print_function
import ansible.executor.task_queue_manager
import ansible.inventory
import ansible.parsing.dataloader
import ansible.playbook.play
import ansible.plugins.callback
import ansible.vars
@lovejavaee
lovejavaee / install-docker-compose.sh
Created May 10, 2017 04:01 — forked from daspecster/install-docker-compose.sh
Centos 7 docker compose install from scratch
#!/bin/bash
sudo yum update -y
sudo yum install -y netstat git rubygems gcc kernel-devel make perl
sudo yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel maven
sudo gem install sass
cd /tmp
@lovejavaee
lovejavaee / tmux-cheatsheet.markdown
Created April 24, 2016 02:15 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@lovejavaee
lovejavaee / gist:06872cd7e18239805f3a
Created March 5, 2016 09:59 — forked from ritou/gist:3149557
OpenID Connect Session Management Demo
@lovejavaee
lovejavaee / custom-submit.js
Created March 2, 2016 06:25
[AngularJS] Custom submit handler that will only submit when all validation is passed
/**
* Custom submit directive that will only submit when all the validation has passed
* for all the fields. This extends on the ng-submit directive provided by AngularJS.
*
* This directive will also remove the 'pristine' flag from all the fields when
* hitting submit, allowing the form to display no errors until the submit button
* is clicked/enter is pressed.
*
* The variable 'app' is the instance of a module.
* E.g. var app = angular.module('my-app', []);
@lovejavaee
lovejavaee / complete.vim
Created January 10, 2016 02:43 — forked from chemzqm/complete.vim
My supertab, complex plugin completion is quite confusing
" Take <tab> for word complete only
" The 'complete' option controls where the keywords are searched (include files, tag files, buffers, and more).
" The 'completeopt' option controls how the completion occurs (for example, whether a menu is shown).
if exists('did_completes_me_loaded') || v:version < 700
finish
endif
let did_completes_me_loaded = 1
function! s:completes_me(shift_tab)
@lovejavaee
lovejavaee / gist:9f819b1277e215e705fd
Created November 5, 2015 16:39
CQ5 curl commands
Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F