Skip to content

Instantly share code, notes, and snippets.

Jonathan Andrew Wolter jawspeak

Block or report user

Report or block jawspeak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jawspeak /
Last active Aug 29, 2015 — forked from RaVbaker/
Reverse engineering Things SQLite tasks database

To open SQLite database run this command in

$ sqlite3 ~/Library/Containers/com.culturedcode.things/Data/Library/Application\ Support/Cultured\ Code/Things/ThingsLibrary.db

In SQLite command-line type this query to get your tasks stats:

sqlite> .mode column
sqlite> .header on
sqlite> select zscheduler, zstatus, ztrashed, count(*) from ZTHING where z_ent = 13 group by  zstatus,ztrashed order by Z_pk desc;
jawspeak / upgrade server ree 1.8.7 to ruby
Last active Dec 10, 2015 — forked from anonymous/upgrade server ree 1.8.7 to ruby
upgrade server ree 1.8.7 to ruby 1.9.3. - install rvm with ruby 1.9.3 - install passenger for the new ruby - update passenger to use the new ruby - uninstall the old ruby
View upgrade server ree 1.8.7 to ruby
# prereqs
sudo apt-get update
sudo /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
# multiuser rvm
$ \curl -L | sudo bash -s stable --ruby=ruby-1.9.3-p362
# add user to rvm group
sudo usermod -a -G rvm ubuntu
$ logout and log back in
jawspeak / mysql_db_and_table_size_queries.sql
Created Sep 27, 2012 — forked from chrisk/mysql_db_and_table_size_queries.sql
MySQL queries to show the size of databases and tables reported by information_schema
View mysql_db_and_table_size_queries.sql
-- Check the total size of each database
tables.TABLE_SCHEMA AS database_name,
ROUND(SUM(tables.DATA_LENGTH + tables.INDEX_LENGTH) / POWER(2, 30), 3) AS database_size_in_gb
FROM information_schema.TABLES AS tables
ORDER BY database_size_in_gb DESC;
-- List all tables larger than 1 GB
jawspeak / c10k-test-client.c
Created Dec 19, 2011 — forked from rsms/c10k-test-client.c
C binary to drive heavy load on a web server. 10K+ requests / second. Seems roughly equivalent to 'ab', and heaver load than httperf.
View c10k-test-client.c
// HTTP client for testing high connection concurrency
// Authors: Richard Jones and Rasmus Andersson
// Released in the public domain. No restrictions, no support.
// SEE:
#include <sys/types.h>
#include <sys/time.h>
#include <sys/queue.h>
jawspeak / realtime_address_correction.rb
Created Dec 6, 2011
Peachtree Data's new realtime address validation service example. Ruby with handsoap gem. 2011-12-05. Their service is described here
View realtime_address_correction.rb
require 'handsoap'
require 'openssl'
class AddressValidator < Handsoap::Service
ENDPOINT = {:uri => '', :version => 1}
endpoint ENDPOINT
jawspeak / asset_optimizer_after.rb
Created Sep 27, 2011
Before and after refactoring of an asset checker - that looks at all assets in a rails project, and finds the ones that appear to be unreferenced.
View asset_optimizer_after.rb
require 'rubygems'
require 'find'
require 'pp'
class UnusedImagesFinder
def find_unused_assets
puts "Lists unused files based upon explicit programatic checks. Requires manual confirmation before deletion."
puts "------------------ Building css from sass ------------------"
system 'rake build_static:stylesheets'
jawspeak /
Created Aug 19, 2010
BeanDumper useful for printing java objects
package com.example.utility;
import static*;
import org.joda.time.LocalDate;
import org.joda.time.LocalDateTime;
import org.joda.time.LocalTime;
import java.beans.BeanInfo;
jawspeak /
Created Jul 15, 2010
New request scope for factory beans. Be careful though since it does not support injecting FactoryBeans as collaborators, but we didn't want this so it's okay. Solves the problem of Spring's Stupid FactoryBeans being instantiated multiple times per req
package com.example.spring;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.web.context.request.AbstractRequestAttributesScope;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
public class FactoryRequestScope extends AbstractRequestAttributesScope{
jawspeak / Example Use Google
Created Jul 1, 2010
java google collections functional programming style
View Example Use Google
// Use functional programming idioms that google collections (now called google guava) give you.
// Given:
private static final Set<String> CLEARABLE_PATHS = Sets.newHashSet("/app/search", "/app/logout");
// Don't be iterative:
// BAD
private boolean shouldClearCookie() {
for (Iterator<String> stringIterator = CLEARABLE_PATHS.iterator(); stringIterator.hasNext();) {
String clearablePath =;
jawspeak /
Created Jun 26, 2010
spring CachingByTypeBeanFactory to cache lookups by type
package com.example.spring;
import org.apache.log4j.Logger;
import org.springframework.beans.BeansException;
import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
You can’t perform that action at this time.