Skip to content

Instantly share code, notes, and snippets.

View spullara's full-sized avatar
💭
The mess cannot go into the program, it piles up around the programmer.

Sam Pullara spullara

💭
The mess cannot go into the program, it piles up around the programmer.
View GitHub Profile
public static boolean sendMail(String to, String from, String subject, String text, String host, String port, String user, String password) throws MessagingException {
Properties props = new Properties();
props.put("mail.smtps.host", host);
props.put("mail.smtps.port", port);
props.put("mail.smtps.user", user);
props.put("mail.smtps.password", password);
return sendMail(to, from, subject, text, props);
}
private static Set<String> adminNeeded = Collections.synchronizedSet(new HashSet<String>());
...
StringBuilder sb = new StringBuilder();
for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
String className = ste.getClassName();
if (className.startsWith("javax.servlet.http.HttpServlet")) break;
if (className.startsWith("java.lang.Thread")
|| !className.startsWith("bagcheck")
|| className.startsWith("bagcheck.services.Util")) continue;
KeyValue[] raw = result.raw();
for (KeyValue kv : raw) {
byte[] value = kv.getValue();
switch(kv.getBuffer()[kv.getQualifierOffset()]) {
case DATA_COLUMN_BYTE:
dataBytes = value;
break;
case VERSION_COLUMN_BYTE:
versionBytes = value;
break;
KeyValue[] raw = result.raw();
for (KeyValue kv : raw) {
byte[] buffer = kv.getBuffer();
int offset = kv.getValueOffset();
int length = kv.getValueLength();
switch(buffer[kv.getQualifierOffset()]) {
case DATA_COLUMN_BYTE:
value = readValue(buffer, schema, format, offset, length);
break;
case VERSION_COLUMN_BYTE:
package com.javarants.instanttalk;
import com.sun.jersey.spi.container.servlet.ServletContainer;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>bagcheck.cli.BagCheckCLI</mainClass>
package preloadagent;
/**
Copyright 2010 Sam Pullara
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
/**
* Create a modal dialog box.
*/
;
(function($) {
$.fn.makeDialog = function () {
return this.each(function() {
var $dialog = $(this);
$dialog.hide().draggable().css('z-index', 3).bind('dlg-launch', null, function() {
var win = $(window);
package bagcheck.scraper;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.w3c.dom.Document;
import org.w3c.tidy.Tidy;
import org.w3c.tidy.TidyUtils;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
var $javarants = jQuery.noConflict(true);
$javarants(document).ready(function($) {
function replacetext(node) {
if (node.nodeType == 3 && node.parentNode.nodeName != "SCRIPT") {
var wordlist = [
"d***", "s***", "f***", "f***", "a***", "a***", "f***",
"f***", "h***", "d***", "c***", "f***", "g***", "g***", "s***",
"c***", "c***", "s***"
];
if (node.nodeValue.replace(/\s/g, '') == "") {