Skip to content

Instantly share code, notes, and snippets.

View lukaszx0's full-sized avatar

Lukasz Strzalkowski lukaszx0

  • Column
View GitHub Profile
@lukaszx0
lukaszx0 / 1_feed_spec.md
Created May 18, 2010 09:08
Anounz.de partner feed specyfication

Feed Specification

Exposing file

Our feed parser can use HTTP or FTP to download your feed file. Althought HTTP is prefered.

XML Structure

@lukaszx0
lukaszx0 / gist:406300
Created May 19, 2010 13:28
Ticket estimated to 2h done in 2 minutes by changing 2 lines
diff --git a/app/controllers/ads_controller.rb b/app/controllers/ads_controller.rb
index fa42e94..19ea145 100644
--- a/app/controllers/ads_controller.rb
+++ b/app/controllers/ads_controller.rb
@@ -92,6 +92,7 @@ class AdsController < ApplicationController
def update
@ad.attributes = params[:ad]
@ad.attach_images(params[:ad_images_ids]) if(params[:ad_images_ids])
+ @ad.checked = false
@ad.save!
module Tty extend self
def blue; bold 34; end
def white; bold 39; end
def red; underline 31; end
def reset; escape 0; end
def bold n; escape "1;#{n}" end
def underline n; escape "4;#{n}" end
def escape n; "\033[#{n}m" if STDOUT.tty? end
end

Writing Commit Messages

One line summary (< 50c)

Longer description (wrap at 72c)

Summary

require 'test_helper'
class ProductsIntegrationTest < ActionController::IntegrationTest
test "browse product page" do
product = Factory.create(:product)
visit product_path(product)
within(:css, ".products.show .product") do
assert_content "Textmate", "h3 a"

World famous FFFFFFFFUUUUUUUUU autotest-growl icon set

fucons

Passed: EWBTE

Failed: problem?

@lukaszx0
lukaszx0 / gist:605049
Created September 30, 2010 18:21 — forked from dje/gist:72840
#! /usr/bin/env ruby
=begin
backshot.rb is a Ruby program driving
Amazon EBS <http://aws.amazon.com/ebs/>
to generate snapshots for backup purposes.
Hourly, daily, weekly, and monthly snapshots
are generated by default.
@lukaszx0
lukaszx0 / mini.rb
Created November 7, 2010 21:50 — forked from defunkt/mini.rb
##
# test/spec/mini 5
# http://gist.github.com/307649
# chris@ozmm.org
#
def context(*args, &block)
return super unless (name = args.first) && block
require 'test/unit'
klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do
def self.test(name, &block)
@lukaszx0
lukaszx0 / hash.rb
Created November 20, 2010 14:24
Flattening hashes with namespaces
require "active_support/core_ext/hash/deep_merge"
class Hash
@@namespace = []
def namespace_flatten(separator = ".")
hash = {}
self.each do |key, value|
key = key.to_s
if value.is_a?(Hash)
@lukaszx0
lukaszx0 / gist:1779098
Created February 9, 2012 10:23
Assets pre-commit precompile
#!/usr/bin/env ruby
assets = `git diff --cached --name-only`.split("\n").find_all{ |file| file =~ /\.(css|js)$/ }
unless assets.empty?
puts "You've changed some of asset files. Building..."
files = `bundle exec rake asset:packager:build_all`.split("\n")[1..-1].map{ |f| f.gsub(/^Created (\/.*\.(css|js))$/, "\\1") }
`git add #{files.join(" ")}`
end