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:41b1386e1af67c454dbcecf9ca18f25b
Last active May 29, 2020 16:20
does not work with code blocks #6
## This is a test
first issue, quote does not escape so `#` will be treated as header.
second issue, the end of this line is again treated as header # as comments
```bash
# this should not be a header but it is by markdowndrawer - third issue
echo "testing"
@Scuilion
Scuilion / addToGroup.exp
Created July 10, 2018 18:44
Expect Script to add user to group where usermod is not usuable.
#!/usr/bin/expect -f
set user [lindex $argv 0];
set hosts {
"host1" "host2"
}
stty -echo
send_user -- "Enter your password:"
expect_user -re "(.*)\n"
@Scuilion
Scuilion / gist:036c53fd7fee2de89701a95822c0fb60
Last active September 21, 2017 19:21
Serialize/Deserialize values into an enum
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.HashMap;
import java.util.Map;
public enum DeviceScheduleFormat {
WEEKDAY("weekday"),
EVEN_ODD("even-odd"),
@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)));
@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
ClassLoader classLoader = TestContact.class.getClassLoader();
URL resource = classLoader.getResource("org/apache/http/impl/client/HttpClientBuilder.class");
@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());
}
<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 / 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);
}
#!/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"