Skip to content

Instantly share code, notes, and snippets.

View redsquirrel's full-sized avatar
🐿️

Dave Hoover redsquirrel

🐿️
  • Flexa, Inc.
  • Evanston, IL
  • 08:42 (UTC -05:00)
  • X @davehoover
View GitHub Profile
Index: app/models/theme.rb
===================================================================
--- app/models/theme.rb (revision 2075)
+++ app/models/theme.rb (revision 2076)
@@ -43,13 +43,6 @@
def border_color
handle_native(:border_color, "EFEFEF")
end
-
- # This will eventually become a first-class property and take over outer_background_color.
class SymbolReplacer {
protected String stringToReplace;
SymbolReplacer(String s) {
this.stringToReplace = s;
}
String replace() {
Pattern symbolPattern = Pattern.compile("\\$([a-zA-Z]\\w*)");
int startingPosition = 0;
import java.util.Date;
public class Worker implements Runnable{
long executionMillis = -1;
public void run() {
for(int i=0; i<100; i++) {
import org.junit.Test;
import static org.junit.Assert.*;
public class WatcherTest {
@Test
public void testJavaVersion() {
assertEquals("1.5.0_16", System.getProperty("java.version"));
import org.junit.Test;
import static org.junit.Assert.*;
public class WatcherTest {
@Test
public void testJavaVersion() {
assertEquals("1.5.0_16", System.getProperty("java.version"));
INSERT
INTO promotion_attempts (audience_member_id, state, mailing_id)
SELECT memberships.audience_member_id, 'ignorant', 18591
FROM memberships
INNER JOIN audience_members ON memberships.audience_member_id = audience_members.id
WHERE memberships.audience_list_id IN (7310)
AND (audience_members.suppressed IS NULL OR audience_members.suppressed = 0)
AND audience_members.email NOT IN (
SELECT promotion_attempts.email
FROM promotion_attempts
DROP PROCEDURE IF EXISTS mailing_prevent_resend;
DELIMITER //
CREATE PROCEDURE mailing_prevent_resend
(target_mailing_id INT, prevent_resend BOOLEAN, target_promotion_id INT)
BEGIN
DROP TEMPORARY TABLE IF EXISTS promotion_attempt_emails;
require 'rubygems'
require 'mechanize'
require 'logger'
require 'band'
agent = WWW::Mechanize.new
agent.max_history = 1
agent.user_agent_alias = 'Mac Safari'
def self.disabled
find(:all, :conditions => {:disabled => true})
end
class Module
def bool_accessor(attribute)
attr_accessor attribute
define_method(attribute.to_s + "?") do
!!send(attribute)
end
end
end
class Bar