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
jawspeak / things_app_sqlite_reverse_engineered_schema.md
Last active Aug 29, 2015 — forked from RaVbaker/readme.md
Reverse engineering Things SQLite tasks database
View things_app_sqlite_reverse_engineered_schema.md

To open SQLite Things.app database run this command in Terminal.app:

$ 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;
ZSCHEDULER  ZSTATUS     ZTRASHED    count(*)
@jawspeak
jawspeak / upgrade server ree 1.8.7 to ruby 1.9.3.sh
Last active Dec 10, 2015 — forked from anonymous/upgrade server ree 1.8.7 to ruby 1.9.3.sh
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 1.9.3.sh
# 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 https://get.rvm.io | 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
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
SELECT
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
GROUP BY tables.TABLE_SCHEMA
ORDER BY database_size_in_gb DESC;
-- List all tables larger than 1 GB
SELECT
@jawspeak
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:
// http://rsms.me/2009/10/05/10k-comet-connections.html
#include <sys/types.h>
#include <sys/time.h>
#include <sys/queue.h>
@jawspeak
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 http://www.linkedin.com/company/peachtree-data-inc./fast-address-real-time-address-validation-368341/product
View realtime_address_correction.rb
require 'handsoap'
require 'openssl'
class AddressValidator < Handsoap::Service
self.logger=$stdout
# https://fastaddress-beta.peachtreedata.com/rtac/?wsdl
ENDPOINT = {:uri => 'https://fastaddress-beta.peachtreedata.com/rtac/', :version => 1}
endpoint ENDPOINT
@jawspeak
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
jawspeak / BeanDumper.java
Created Aug 19, 2010
BeanDumper useful for printing java objects
View BeanDumper.java
package com.example.utility;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import static com.google.common.collect.Iterables.*;
import org.joda.time.LocalDate;
import org.joda.time.LocalDateTime;
import org.joda.time.LocalTime;
import java.beans.BeanInfo;
@jawspeak
jawspeak / FactoryRequestScope.java
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
View FactoryRequestScope.java
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
jawspeak / Example Use Google Collections.java
Created Jul 1, 2010
java google collections functional programming style
View Example Use Google Collections.java
// 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 = stringIterator.next();
@jawspeak
jawspeak / CachingByTypeBeanFactory.java
Created Jun 26, 2010
spring CachingByTypeBeanFactory to cache lookups by type
View CachingByTypeBeanFactory.java
package com.example.spring;
import org.apache.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
You can’t perform that action at this time.