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 gist:6874053
#/usr/bin/env bash
set -e
set -x
apt-get update
apt-get upgrade
apt-get -y install build-essential curl git-core openssl libreadline6 libreadline6-dev \
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev \
@myabc
myabc / gist:3748905
Created Sep 19, 2012 — forked from gnunicorn/gist:3748738
Git for Beginners: Call for Coaches
View gist:3748905

The OpenTechSchool has set up and hosted a few tech workshops and meetups here in Berlin now. Aside from the monthly Beginners Meetup and hosting the Udacity Global Meetup we hosted workshops for program beginners in Python and Javascript on our own and on the premise of CampusParty.

One thing that was extraordinary popular on CampusParty was the Workshop on Git for beginners. And we decided to do it again, this time with a closer focus on version control as a major benefit in code sharing (by using git and github) for beginners - free of charge.

So if you are interested in

View illegal_nesting.haml
:javascript
function write_script() {
document.write('\x3Cscript type="text/javascript" src="foo.js">\x3C/script>');
}
write_script();
@myabc
myabc / ice_nine.rb
Created Mar 18, 2012
Spike: Extensible Deep Freeze
View ice_nine.rb
# I didn't want to monkey patch #deep_freeze into core classes, plus I wanted
# to have a way to easily add new classes without modifying a case statement or
# similar. Plus I wanted a way for people to be able to specify exceptions for
# their own classes without patching mine.
module IceNine
def self.deep_freeze(object)
return object if object.frozen?
f = Freezer[object.class.name]
f.deep_freeze(object)
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 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
View gist:239613
require "rubygems"
require "dm-core"
require "dm-migrations"
DataMapper.setup(:default, "mysql://test:@localhost/test")
class Circle
include DataMapper::Resource
View gist:221466
== Interfaces
=== Finder Interface
+ #[]
+ #all
+ #at
- #fetch <-- needs specs
+ #first
+ #first_or_create
View migrate_articles_from_mephisto_markdown_files.rb
# To use:
# mkdir _posts
# script/runner migrate_articles_from_mephisto_markdown_files.rb
articles = Article.find(:all)
articles.each do |article|
published_at = "#{article.published_at.year}-#{article.published_at.month}-#{article.published_at.day}" unless article.published_at.nil?
author = article.user.login
permalink = article.permalink
View gist:192941
gem list '\A(?:(?:d[mo])[_-]|data_?(?:mapper|objects)|extlib)' --no-versions \
| xargs sudo gem uninstall -aIx
You can’t perform that action at this time.