Skip to content

Instantly share code, notes, and snippets.

View skylerto's full-sized avatar

Skyler Layne skylerto

View GitHub Profile
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Java
[*.java]
cp /mingw64/bin/curl.exe /c/HashiCorp/Vagrant/embedded/bin/curl.exe
@skylerto
skylerto / countdowntomac.md
Last active August 17, 2016 16:02
A list of itches windows just can't scratch...

Programming

All things programming related (editors, langs, etc.)

  • javac
  • ruby
  • irb (the true desktop calculator)
  • macVim
  • GNU, GCC (compile from src please)
  • go
  • angular 2 cli
body {
background-color: #89daca;
}
#!/usr/bin/env ruby
class Commit
attr_accessor :hash, :message
def initialize commit
line = commit.split(" ")
@hash = line[0]
@message = line[1..(line.size)].join(" ")
end
#! /usr/bin/env ruby
num_secs = 15 * 60
message = "AUTO COMMIT"
while true
sleep(num_secs)
puts "executing auto-commit"
commit = %(git commit -vm #{message})
end
#!/usr/bin/env ruby
ctags = %x(ctags -R -f ./.git/tag ./src)
lint = %x(npm run lint)
puts ctags
puts lint
@Bean(name = "KafkaRouteProducer")
public RouteBuilder kafkaRouteProducer() {
return new RouteBuilder() {
public void configure() {
from("direct:kafkaRoute")
.to("kafka:localhost:9092?topic=test&groupId=testing&autoOffsetReset=earliest&consumersCount=1")
.bean(KafkaOutputBean.class);
}
};
}
@Controller
@ResponseBody
@RequestMapping("/message")
public class MessageController {
ObjectMapper mapper = new ObjectMapper();
@Autowired
CamelContext camelContext;
public class KafkaOutputBean {
public void printKafkaBody(String body) {
try {
Notification message = new ObjectMapper().readValue(body, Notification.class);
System.out.println("KafkaBody result >>>>> " + message.toString());
} catch (JsonParseException e) {
System.out.println(body + " cannot be marshalled to a Notification.class");
} catch (JsonMappingException e) {
e.printStackTrace();