This file contains hidden or 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
(Thanks to Adam Grant) | |
Used with Autowatchr helper gem, Watchr adds testing functionality to your project | |
ala Zentest/autotest without the cruft and (sometimes) confusing callback hooks | |
that can lead someone to stop testing and turn to drinking massive amounts of Tab Cola. | |
The script contains a set of simple rules that map observed files to an action. | |
Its DSL is a single method: | |
watch(pattern, &action) |
This file contains hidden or 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
def self.create_from_array(attrs) | |
keys = attrs.first.keys | |
d = ActiveRecord::Base.connection | |
d.execute <<SQL | |
INSERT INTO #{table_name} (#{keys * ', '}, created_at, updated_at) | |
VALUES #{attrs.map do |a| "(#{keys.map{|k| d.quote(a[k].to_s)} * ','}, | |
NOW(), | |
NOW())"} | |
ON DUPLICATE KEY UPDATE #{keys.map{|k| "#{k} = VALUES(#{k})"} * ', '} | |
SQL |
This file contains hidden or 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
#bundle install to set this stuff up | |
source :rubyforge | |
gem 'rack' | |
gem 'rails', '>= 3.0.4' | |
#gem 'rack-ssl' | |
#gem 'thin' | |
gem 'unicorn' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' |
This file contains hidden or 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
$ gem list --local | |
*** LOCAL GEMS *** | |
abstract (1.0.0) | |
actionmailer (3.1.3, 3.1.0, 3.0.7, 3.0.6) | |
actionpack (3.1.3, 3.1.0, 3.0.7, 3.0.6) | |
activeadmin (0.3.2, 0.2.2) | |
activemodel (3.1.3, 3.1.0, 3.0.9, 3.0.7, 3.0.6) | |
activerecord (3.1.3, 3.1.0, 3.0.9, 3.0.7, 3.0.6) |
This file contains hidden or 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
$ bundle exec gem list --local | |
*** LOCAL GEMS *** | |
actionmailer (3.1.3) | |
actionpack (3.1.3) | |
activemerchant (1.7.0) | |
activemodel (3.1.3) | |
activerecord (3.1.3) | |
activeresource (3.1.3) |
This file contains hidden or 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
/home/www/.rvm/gems/ruby-1.9.2-p180/gems/authlogic-3.0.3/lib/authlogic/controller_adapters/rails_adapter.rb:48:in `<top (required)>': uninitialized constant ActionController (NameError) | |
from /home/www/.rvm/gems/ruby-1.9.2-p180/gems/authlogic-3.0.3/lib/authlogic.rb:62:in `<top (required)>' | |
from /home/www/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require' | |
from /home/www/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require' | |
from /home/www/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each' | |
from /home/www/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require' | |
from /home/www/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each' | |
from /home/www/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require' | |
from /home/www/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.21/lib/bundler.rb:122:in `require' | |
from /hom |
This file contains hidden or 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
$ pg_dump -h localhost -U webserver -p 5433 production -f backup/12-08-10.dump | |
pg_dump: SQL command failed | |
pg_dump: Error message from server: ERROR: could not access file "$libdir/hstore": No such file or directory | |
pg_dump: The command was: COPY public.event_logs (id, auth_token, text, created_at, updated_at, user_id, data, remote_creation_date) TO stdout; |
This file contains hidden or 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
import 'package:flutter/material.dart'; | |
import 'dice_button.dart'; | |
import 'dice_rack.dart'; | |
import 'dart:developer'; | |
class DiceRow extends StatefulWidget { | |
final _RowState content = _RowState(); | |
final RackState rack; | |
DiceRow(this.rack); |
This file contains hidden or 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
$ flutter run --verbose -d chrome | |
[ +48 ms] executing: [/Users/gisborne/dev/bin/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H | |
[ +84 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H | |
[ +2 ms] e2aa9e13cef8f3dc17c2de55dc9639d4c3968d21 | |
[ +2 ms] executing: [/Users/gisborne/dev/bin/flutter/] git describe --match v*.*.* --first-parent --long --tags | |
[ +73 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags | |
[ +11 ms] v1.14.3-39-ge2aa9e13c | |
[ +41 ms] executing: [/Users/gisborne/dev/bin/flutter/] git rev-parse --abbrev-ref --symbolic @{u} | |
[ +22 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} | |
[ +1 ms] origin/master |
This file contains hidden or 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
import 'package:flutter/material.dart'; | |
import 'package:flutter_webrtc/flutter_webrtc.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); |