Skip to content

Instantly share code, notes, and snippets.

@tzhbami7
tzhbami7 / gist:1327347
Created October 31, 2011 12:04
Server log using save()
Started POST "/baan_imports" for 127.0.0.1 at 2011-10-31 12:27:57 +0100
Processing by BaanImportsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"0b/AodvncerrLMJgxiS6NCF5lR02bLwGaehpYzEkQQQ=", "baan_import"=>{"baan_upload"=>#<ActionDispatch::Http::UploadedFile:0x007ff40464a078 @original_filename="11-08-14-export.csv", @content_type="text/csv", @headers="Content-Disposition: form-data; name=\"baan_import[baan_upload]\"; filename=\"11-08-14-export.csv\"\r\nContent-Type: text/csv\r\n", @tempfile=#<File:/var/folders/bv/hz70f7255hv00p9cq0tctwm40000gn/T/RackMultipart20111031-41079-cwm2lm>>}, "commit"=>"Upload"}
SQL (33.7ms) describe `roles_users`
User Load (1.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
SQL (1.2ms) BEGIN
SQL (2.1ms) describe `baan_imports`
AREL (0.3ms) INSERT INTO `baan_imports` (`baan_import_group_id`, `importing_date`, `created_at`, `updated_at`, `baan_upload_file_name`, `baan_upload_content_type`, `baan_upload_file_size`, `baan_up
@tzhbami7
tzhbami7 / gist:1327359
Created October 31, 2011 12:11
Server log using create()
Started POST "/baan_imports" for 127.0.0.1 at 2011-10-31 12:43:31 +0100
Processing by BaanImportsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"0b/AodvncerrLMJgxiS6NCF5lR02bLwGaehpYzEkQQQ=", "baan_import"=>{"baan_upload"=>#<ActionDispatch::Http::UploadedFile:0x007fb682bcaf08 @original_filename="11-08-14-export.csv", @content_type="text/csv", @headers="Content-Disposition: form-data; name=\"baan_import[baan_upload]\"; filename=\"11-08-14-export.csv\"\r\nContent-Type: text/csv\r\n", @tempfile=#<File:/var/folders/bv/hz70f7255hv00p9cq0tctwm40000gn/T/RackMultipart20111031-41084-rwz4we>>}, "commit"=>"Upload"}
SQL (31.4ms) describe `roles_users`
User Load (1.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
SQL (0.2ms) BEGIN
SQL (3.2ms) describe `baan_imports`
AREL (0.4ms) INSERT INTO `baan_imports` (`baan_import_group_id`, `importing_date`, `created_at`, `updated_at`, `baan_upload_file_name`, `baan_upload_content_type`, `baan_upload_file_size`, `baan_up
@tzhbami7
tzhbami7 / bootstrap-ruby.sh
Created October 9, 2012 15:03
Install Ruby with rbenv/ruby-build on Ubuntu 10.04 with openssl
#!/bin/bash
set -e # exit on error
### README
# * built for Ubuntu (Lucid Lynx)
# * uses GIT via SSH because of !@#$% proxy at work
# * installs your desired ruby version (1.9.2-p290 per default) using rbenv
# ** including openssl (needed by bundler)
# ** including sqlite (probably needed for rails apps)
#
# Before you start:
@tzhbami7
tzhbami7 / gist:4738286
Created February 8, 2013 11:26
der totale krieg!
unction RemoteWindow() {
var self = Ti.UI.createWindow({
title:"Load remote Data",
backgroundColor:'#fff'
});
var resultTbl = Ti.UI.createTableView({
separatorStyle: Titanium.UI.iPhone.TableViewSeparatorStyle.NONE
});
2013-03-12 15:52:25.380 Paatle[29177:907] -[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x1fd60380
2013-03-12 15:52:25.382 Paatle[29177:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x1fd60380'
*** First throw call stack:
(0x3229e3e7 0x39f8f963 0x322a1f31 0x322a064d 0x321f8208 0xad99f 0x97ce7 0x340f8569 0x340dd391 0x340f4827 0x340b08c7 0x33e5c513 0x33e5c0b5 0x33e5cfd9 0x33e5c9c3 0x33e5c7d5 0x33e5c639 0x32273941 0x32271c39 0x32271f93 0x321e523d 0x321e50c9 0x35dc333b 0x341012b9 0x941ad 0x3a3bcb20)
@tzhbami7
tzhbami7 / gist:5927854
Created July 4, 2013 13:44
time interval
//Constants
#define SECOND 1
#define MINUTE (60 * SECOND)
#define HOUR (60 * MINUTE)
#define DAY (24 * HOUR)
#define MONTH (30 * DAY)
- (NSString*)timeIntervalWithStartDate:(NSDate*)d1 withEndDate:(NSDate*)d2
{
//Calculate the delta in seconds between the two dates
# Add the remote, call it "upstream":
git remote add upstream https://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream
# Make sure that you're on your master branch:
This file has been truncated, but you can view the full file.
<ffd8ffe0 00104a46 49460001 01000001 00010000 ffe10058 45786966 00004d4d 002a0000 00080002 01120003 00000001 00010000 87690004 00000001 00000026 00000000 0003a001 00030000 00010001 0000a002 00040000 00010000 0640a003 00040000 00010000 04b00000 0000ffdb 00430001 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 010101ff db004301 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 ffc00011 0804b006 40030111 00021101 031101ff c4001f00 00010501 01010101 01000000 00000000 00010203 04050607 08090a0b ffc400b5 10000201 03030204 03050504 04000001 7d010203 00041105 12213141 06135161 07227114 328191a1 082342b1 c11552d1 f0243362 7282090a 16171819 1a252627 28292a34 35363738 393a4344 45464748 494a5354 55565758 595a6364 65666768 696a7374 75767778 797a8384 85868788 898a9293 94959697 98999aa2 a3a4a5a6 a7a8a9aa b2b3b4b5 b6b7b8b9 bac2c3c4 c5c6c7c8 c9cad2

OS X 10.10 Guide

Here's what I did to get things working.

1. Install Xcode 6

Yep, over at: https://developer.apple.com

2. Install the Command Line Tools (CLT)

tzhbami7@jack-black:~/Code/rails/agricircle$ bundle exec rake crop_import:import
importing crops for planning
rake aborted!
RSolr::Error::Http: RSolr::Error::Http - 400 Bad Request
Error: {'responseHeader'=>{'status'=>400,'QTime'=>1},'error'=>{'msg'=>'ERROR: [doc=Crop 3] unknown field \'name_de_ac\'','code'=>400}}
Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><add><doc><field name=\"id\">Crop 3</field><field name=\"type\">Crop</field><field name=\"type\">ActiveRecord::Base</field><field name=\"class_name\">Crop</field><field name=\"name_de_s\">Winterweizen</field><field name=\"with_crop_stages_b\">true</field><field name=\"name_de_ac\">Winterweizen</field><field name=\"name_de_dynamic\">Winterweizen</field></doc></add>"
Backtrace: /home/tzhbami7/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/rsolr-1.0.10/lib/rsolr/client.rb:283:in `adapt_response'
/home/tzhbami7/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/rsolr-1.0.10/lib/rsolr/client.rb:190:in `execute'