Skip to content

Instantly share code, notes, and snippets.

View Scuilion's full-sized avatar
👻

Kevin O'Neal Scuilion

👻
View GitHub Profile
@Scuilion
Scuilion / gist:6528120
Created September 11, 2013 18:54
build.grade for plugin
apply plugin: 'groovy'
apply plugin: 'maven'
repositories {
mavenCentral()
}
sourceSets{
integrationTest{
compileClasspath += sourceSets.main.output + sourceSets.test.output + configurations.integrationTestCompile
def list = [-100,3,4,2,5,6,7,-2,0]
def sorted =[list[0]]
long startTime = System.currentTimeMillis();
for(int i=1; i < list.size; i++){
def insert = list[i]
for(int j=sorted.size-1; j>=0; j--){
if(insert > sorted[j]){
sorted.addAll(j+1,insert)
break;

Keybase proof

I hereby claim:

  • I am scuilion on github.
  • I am scuilion (https://keybase.io/scuilion) on keybase.
  • I have a public key whose fingerprint is FD61 BC1D D62F 6B41 9AA2 0BF7 F757 2F16 57AB 9A4A

To claim this, I am signing this object:

#!/usr/bin/env bash
files=$(git diff --name-only HEAD | tr '\n' ' ' )
e=0
for f in $files
do
if ! git show :"$f" | iconv -f UTF-8 -t UTF-8 "$f" >/dev/null 2>&1
then
e=1
echo "The following file is not UTF-8: $f"
@Scuilion
Scuilion / gist:d1609aa3bcdf606be163
Created September 27, 2015 17:06
Because Learning Deprecated Features is Great
<html>
<head>
<script>
var standup = {};
standup.webdb = {};
standup.webdb.db = null;
standup.webdb.open = function() {
var dbSize = 5 * 1024 * 1024; // 5MB
standup.webdb.db = openDatabase("Standup", "1", "standup manager", dbSize);
}
<html>
<head>
<title>Daily Standup</title>
<style type="text/css">
#dailyStatus {
width: 100%; height: 100%; left: 0; top: 0; z-index: 10; padding: 4rem; font-size:2rem; font-family:Helvetica; line-height:1.4; margin:0 auto;white-space: pre;overflow: auto
}
</style>
<script>
@Scuilion
Scuilion / Utils.java Testutils.java
Created October 27, 2015 04:50
Java 8 Fun with filters
public class Utils {
public static List<IArtist> cull(List<IArtist> artists, List<GenreType> include, List<GenreType> exclude) {
List<GenreType> optExclude = Optional.ofNullable(exclude).orElse(new ArrayList<GenreType>());
List<GenreType> optInclude = Optional.ofNullable(include).orElse(new ArrayList<GenreType>());
return artists.stream()
.filter(isMatch(optInclude))
.filter(isMatch(optExclude).negate())
.collect(Collectors.toList());
}
ClassLoader classLoader = TestContact.class.getClassLoader();
URL resource = classLoader.getResource("org/apache/http/impl/client/HttpClientBuilder.class");
@Scuilion
Scuilion / prepare-commit-msg.sh
Last active October 26, 2016 21:10 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/usr/bin/env bash
BRANCHES_TO_SKIP=(master develop test)
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
DASHES="${BRANCH_NAME//[^-]}"
if [ ${#DASHES} -gt 1 ]; then
@Scuilion
Scuilion / gist:7feaec2a987c53f2a45c096085e4ffde
Created August 16, 2017 22:49
Cascading Select Creation Using Jira Rest Java Client
final IssueInputBuilder issueInputBuilder = new IssueInputBuilder("SUP", 10900L, "summary");
final Map<String, Object> childField = new HashMap<>();
childField.put("value", "Outage");
final Map<String, Object> customField = new HashMap<>();
customField.put("value", "Customer Call");
customField.put("child", new ComplexIssueInputFieldValue(childField));
issueInputBuilder.setFieldInput(new FieldInput("customfield_12345", new ComplexIssueInputFieldValue(customField)));