Skip to content

Instantly share code, notes, and snippets.

View skylerto's full-sized avatar

Skyler Layne skylerto

View GitHub Profile
module Properties
class << self
def load_properties(properties_filename)
properties = {}
File.open(properties_filename, 'r') do |properties_file|
properties_file.read.each_line do |line|
line.strip!
if (line[0] != ?# and line[0] != ?=)
i = line.index('=')
if (i)
package com.inlet.delivery;
import java.io.InputStream;
import java.util.List;
import javax.ws.rs.core.MediaType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<div class="container ... ">
<div class="
component ... ${properties.step < 1 ? 'inactive' : ''}
${properties.step === 1 ? 'active' : ''}
${properties.step > 1 ? 'completed' : ''}
">
STEP 1
</div>
<div class="
component ... ${properties.step < 2 ? 'inactive' : ''}
<div class="container ... ">
<div class="component ... ${getStepClass(properties.step, 1)}">
STEP 1
</div>
<div class="component ... ${getStepClass(properties.step, 2)}">
STEP 2
</div>
<div class="component ... ${getStepClass(properties.step, 3)}">
STEP 3
</div>
<div class="container ... ">
<div class="component ... ${getStepClass(properties.step, 1}">
STEP 1
</div>
<div class="component ... ${getStepClass(properties.step, 2}">
STEP 2
</div>
<div class="component ... ${getStepClass(properties.step, 3}">
STEP 3
</div>
module Util
class << self
def first_line file_name
File.open(file_name, 'r') do |f|
p f.gets
end
rescue Errno::ENOENT => ex
"Do the file creation: #{ex.to_s}"
end
end
module Util
class << self
def first_line file_name
File.open(file_name, 'r') do |f|
p f.gets
end
rescue Errno::ENOENT => ex
handle_error(ex)
end
import * as path from 'path';
const WebpackMd5Hash = require('webpack-md5-hash');
const CompressionPlugin = require('compression-webpack-plugin');
import * as webpack from 'webpack';
export const getWebpackProdConfigPartial = function(projectRoot: string, appConfig: any) {
return {
debug: false,
devtool: 'source-map',
output: {
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();
@Controller
@ResponseBody
@RequestMapping("/message")
public class MessageController {
ObjectMapper mapper = new ObjectMapper();
@Autowired
CamelContext camelContext;