Skip to content

Instantly share code, notes, and snippets.

View mlooney's full-sized avatar

McClain Looney mlooney

View GitHub Profile
1) Error:
test: an import should all have same timestamp. (BeanieBastardftpImporterTest):
RuntimeError: Dates do not match: 200906 expected, was 200905
app/importers/beanie_bastardftp_importer.rb:66:in `parse'
app/importers/importer.rb:43:in `perform'
app/importers/importer.rb:43:in `perform'
/test/unit/importers/beanie_bastardftp_importer_test.rb:28:in `__bind_1243954709_440055'
vendor/gems/thoughtbot-shoulda-2.10.1/lib/shoulda/context.rb:271:in `call'
vendor/gems/thoughtbot-shoulda-2.10.1/lib/shoulda/context.rb:271:in `run_current_setup_blocks'
def mgr_sum_for_affiliate_for_month(affiliate, m=Date.today)
ImporterData.count_by_sql(['select sum(field_number_value) from importer_datas where (field_name = ? and poker_room_id=? and member_id=?) and (created_at < ? and created_at > ?)', 'MGR', affiliate.id, self.id, m.end_of_month, m.beginning_of_month])
end
@mlooney
mlooney / gist:170456
Created August 19, 2009 16:50
An evil hack
require 'test/unit'
class Funky
def self.datehack(a=1, b=a+1)
b
end
def self.evildatehack(a=b+1, b=1)
a
end
end
---> Building git-core
DEBUG: Executing org.macports.build (git-core)
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.6'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_git-core/work/git-1.6.4.1" && /usr/bin/make -j2 all CFLAGS="-Wall -O2 -I/opt/local/include" LDFLAGS="-L/opt/local/lib" CC=/usr/bin/gcc-4.2 prefix=/opt/local CURLDIR=/opt/local OPENSSLDIR=/opt/local ICONVDIR=/opt/local PERL_PATH="/opt/local/bin/perl" NO_FINK=1 NO_DARWIN_PORTS=1 NO_R_TO_GCC_LINKER=1'
SUBDIR git-gui
SUBDIR gitk-git
make[1]: Nothing to be done for `all'.
SUBDIR perl
make[2]: *** No rule to make target `/opt/local/lib/perl5/5.8.8/darwin-2level/Config.pm', needed by `perl.mak'. Stop.
make[1]: *** [all] Error 2
select o.object_id, o.object_type_id, satr_0.value as name,
satr_5.value as vendor_id, satr_11.value as long_desc, satr_138.value as year from object o
left outer join attr__string_attribute as satr_0
on (satr_0.object_id=o.object_id and satr_0.attribute_id=0)
left outer join attr__string_attribute as satr_5
on (satr_5.object_id=o.object_id and satr_5.attribute_id=5)
left outer join attr__text_attribute as satr_11
on (satr_11.object_id=o.object_id and satr_11.attribute_id=11)
left outer join attr__string_attribute as satr_138
on (satr_138.object_id=o.object_id and satr_138.attribute_id=138)
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.4.3)
** Extensions loaded: hggit, graphlog, color, bookmarks, hgshelve, histedit
Traceback (most recent call last):
File "/usr/local/bin/hg", line 5, in <module>
pkg_resources.run_script('mercurial==1.4.3', 'hg')
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 442, in run_script
self.require(requires)[0].run_script(script_name, ns)
diff --git a/Makefile b/Makefile
index 5f89db2..41465f0 100644
--- a/Makefile
+++ b/Makefile
@@ -18,9 +18,9 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-CFLAGS = `pkg-config lua5.1 --cflags` -fPIC -O3 -Wall
-LFLAGS = -shared `pkg-config --libs --cflags libzmq`
// Locate update methods
Method subscriptionMethod = null;
ArrayList<Method> updateMethods = new ArrayList<Method>();
for (Method method : subscriber.getClass().getMethods())
{
if ((method.getName().equals("update")) &&
(Modifier.isPublic(method.getModifiers())))
{
updateMethods.add(method);
}
<form accept-charset="UTF-8" action="/user_session" class="form-stacked formtastic user_session" id="new_user_session" method="post">
<fieldset class="inputs" name="Login">
<legend><span>Login</span></legend>
<ol>
<li class="string required" id="user_session_email_input">
<label for="user_session_email">Email</label>
<input id="user_session_email" name="user_session[email]" type="text">
</li>
<li class="password required" id="user_session_password_input">
<label for="user_session_password">Password</label>
@mlooney
mlooney / gist:1653268
Created January 21, 2012 16:52
Extract chat history from skype logs
corpus = Hash.new {|h,k| h[k]=[]}
SQLite3::Database.new( "/Users/username/Library/Application Support/Skype/skypename/main.db", :readonly=>true ) do |db|
db.execute("select timestamp,author, body_xml from messages") do |row|
ts, author, body = row
corpus[author]<<(body) if body
end
end
corpus.each do |k,v|
File.open("corpus_#{k}.txt", 'w') do |f|