This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d:\vim\vim72>vim --version | |
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Mar 24 2010 17:13:56) | |
MS-Windows 32-bit console version | |
Included patches: 1-411 | |
Compiled by [email protected] | |
Huge version without GUI. Features included (+) or not (-): | |
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent | |
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments | |
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic | |
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These are VERY basic instructions for getting MS SQL Server working via ODBC on Mac OSX Snow Leopard, with rails. It assumes you know how to make / install libraries from source. It took a LOT of trial and error so your results may vary. | |
1. Install unixODBC | |
Get from http://www.unixodbc.org | |
./configure --prefix=/usr/local --enable-gui=no | |
make | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DBUtil < ActiveRecord::Migration | |
def self.create_history(table, history_table, columns, to_use) | |
#create the history table | |
create_table(history_table) | |
to_use += ["id", "updated_at", "updated_by"] if to_use != nil | |
columns.each do |c| | |
next if to_use != nil && !to_use.include?(c.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DBUtil sample Usage | |
the DBUtil.create_history line shows that only some of the columns are going to have history kept for them. The other columns will be ignored in the user_history table, and the triggers that are created by DBUtil.rb | |
class CreateUsers < ActiveRecord::Migration | |
require File.expand_path('db/dbutil.rb') | |
def self.up | |
create_table :users do |t| | |
t.column :login, :string, :null => false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When /^(?:|I )fill in the following(?: within "([^"]*)")?:$/ do |selector, fields| | |
with_scope(selector) do | |
fields.rows_hash.each do |name, value| | |
field = find_field(name) | |
case field[:type] | |
when "select-one" | |
When %{I select "#{value}" from "#{name}"} | |
when "select-multiple" | |
When %{I select "#{value}" from "#{name}"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DatatableHelper | |
#converts an object array into DataTable format | |
#example output: | |
#{"sEcho": 1, "iTotalRecords": 57, "iTotalDisplayRecords": 57, | |
#{"aaData": [ | |
#["Gecko","Firefox 1.0","Win 98+ / OSX.2+","1.7","A"],["Gecko","Firefox 1.5","Win 98+ / OSX.2+","1.8","A"],["Gecko","Firefox 2.0","Win 98+ / OSX.2+","1.8","A"],["Gecko","Firefox 3.0","Win 2k+ / OSX.3+","1.9","A"],["Gecko","Camino 1.0","OSX.2+","1.8","A"],["Gecko","Camino 1.5","OSX.3+","1.8","A"],["Gecko","Netscape 7.2","Win 95+ / Mac OS 8.6-9.2","1.7","A"],["Gecko","Netscape Browser 8","Win 98SE+","1.7","A"],["Gecko","Netscape Navigator 9","Win 98+ / OSX.2+","1.8","A"],["Gecko","Mozilla 1.0","Win 95+ / OSX.1+","1","A"] | |
#] } | |
def self.to_table(data, params = {}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.enter = function(callback) { | |
this.keypress(function(e){ | |
if (e.which == 13) { | |
e.preventDefault(); | |
callback.call(this); | |
} | |
}); | |
return this; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset='utf-8'> | |
<html lang="en"> | |
<head> | |
<link rel="stylesheet" href="jquery.svg.css"/> | |
<script src="jquery-1.7.min.js"></script> | |
<script src="jquery.svg.js"></script> | |
<script src="jquery.svgdom.js"></script> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mysql::Error: Table 'pestnowtest.orders' doesn't exist: SHOW FULL FIELDS FROM `orders` | |
/Users/dave/.rvm/gems/ruby-1.9.2-p290@pestnow/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:233:in `query' | |
/Users/dave/.rvm/gems/ruby-1.9.2-p290@pestnow/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:233:in `block in execute' | |
/Users/dave/.rvm/gems/ruby-1.9.2-p290@pestnow/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log' | |
/Users/dave/.rvm/gems/ruby-1.9.2-p290@pestnow/gems/activesupport-3.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument' | |
/Users/dave/.rvm/gems/ruby-1.9.2-p290@pestnow/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log' | |
/Users/dave/.rvm/gems/ruby-1.9.2-p290@pestnow/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:233:in `execute' | |
/Users/dave/.rvm/gems/ruby-1.9.2-p290@pestno |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install with: | |
# bash < <(curl -L https://raw.github.com/gist/2017386) | |
# | |
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug | |
echo "Installing ruby-debug with ruby-1.9.3-p125 ..." | |
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem | |
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem |
OlderNewer