Skip to content

Instantly share code, notes, and snippets.

Alex Coles myabc

Block or report user

Report or block myabc

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
View run-scripts.sh
#!/bin/bash
# 1. Save this script somewhere
# 2. Change the following variable, adding the correct path and file extension
# for the files you want to handle.
files="directory/*.extension"
for f in $files; do
echo "Executing commands for file: $f ...";
# 3a. Add Command 1
View decode-dragonfly.sh
#!/bin/bash
ruby -r base64 -r pp -e "pp Marshal.load(Base64.decode64('$1'))"
View gist:963415
2011-05-08 20:11:56,684 INFO [Log4jLogger] : DataObjects::SQLError - DSRA9122E: class com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement enthält keine Objekte vom Typ interface oracle.jdbc.OraclePreparedStatement.:
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:276:in `with_connection'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:113:in `create'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:85:in `each'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle
View Gemfile
gem 'friendly_id', '~> 3.1.0'
gem 'friendly_id_datamapper','~> 3.1.0',:git => 'http://github.com/myabc/friendly_id_datamapper.git'
View application.rb
config.after_initialize do
require 'app/support/naming_conventions'
::DataMapper.repository.adapter.resource_naming_convention = ::App::NamingConventions::Resource
end
View Gemfile
source :rubygems
# Specify the database driver
gem 'mysql'
#gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'rails', '~> 2.3.5'
gem 'highline', '1.5.1'
gem 'authlogic', '2.1.3'
gem 'authlogic-oid', '1.0.4', :require => 'authlogic_openid'
View gist:422461
diff --git a/config/boot.rb b/config/boot.rb
index 81d20d9..f1a1c10 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -157,5 +157,19 @@ module Spree
end
end
+class Spree::Boot
+ def run
View gist:377647
~ (0.034) DROP TABLE IF EXISTS `posts`
~ (0.015) com.mysql.jdbc.PreparedStatement@15ede11: SHOW TABLES LIKE 'posts'
~ (0.001) com.mysql.jdbc.PreparedStatement@3d511e: SHOW VARIABLES LIKE 'character_set_connection'
~ (0.001) com.mysql.jdbc.PreparedStatement@d41f3: SHOW VARIABLES LIKE 'collation_connection'
~ (0.771) CREATE TABLE `posts` (`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `title` VARCHAR(50), `body` TEXT, `created_at` DATE, PRIMARY KEY(`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
~ (0.024) INSERT INTO `posts` (`title`, `body`, `created_at`) VALUES ('foo', 'adngksbfsf kvbsdfblsf vksfbkvbsf', '2010-04-24')
~ (0.016) INSERT INTO `posts` (`title`, `body`, `created_at`) VALUES ('foo', 'adngksbfsf kvbsdfblsf vksfbkvbsf', '2010-04-23')
~ (0.009) INSERT INTO `posts` (`title`, `body`, `created_at`) VALUES ('foo', 'adngksbfsf kvbsdfblsf vksfbkvbsf', '2010-04-22')
~ (0.002) INSERT INTO `posts` (`title`, `body`, `created_at`) VALUES ('foo', 'adngksbfsf kvbsdfblsf vksfbkvbsf', '201
View Software Shitlist.markdown

Software Shitlist

Software so bad it really shouldn't be tolerated.

  • Microsoft Powerpoint
  • Expression Engine
  • Anything written with Adobe AIR
View mysql_and_sqlite3_example.rb
require 'rubygems'
require 'dm-core'
DataMapper::Logger.new(STDOUT, :debug)
DataMapper.setup(:default, 'mysql://root:@localhost/test')
DataMapper.setup(:logs, "sqlite3:///tmp/test.db")
class LoggedEvent
include DataMapper::Resource
You can’t perform that action at this time.