Skip to content

Instantly share code, notes, and snippets.

Adam Pohorecki psyho

Block or report user

Report or block psyho

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
@psyho
psyho / cli_builder.rb
Created Sep 1, 2016
CLI builder example
View cli_builder.rb
module HashConstructor
def initialize(attrs = {})
attrs.each do |name, value|
send("#{name}=", value)
end
end
end
class AwsCli
include HashConstructor
@psyho
psyho / core.clj
Last active Oct 15, 2015
Property-based testing dojo
View core.clj
(ns dojo.core
(:require [clojure.test.check :as tc]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[clojure.test :refer :all]))
(def balls identity)
(defn add-ball [rack ball] (conj rack ball))
@psyho
psyho / foo_spec.rb
Created Apr 29, 2014
How to combine Bogus and rspec-mocks (or other mocking library) in one project
View foo_spec.rb
require 'spec_helper'
class Foo
def initialize(bar)
@bar = bar
end
def foo
@bar.bar
end
View speaker.md
View speaker.md
@psyho
psyho / bogus-minitest.rb
Created May 11, 2013
Bogus.have_received in minispec
View bogus-minitest.rb
require 'minitest/autorun'
require 'set' # bummer, I forgot to require set in Bogus
require 'bogus'
class Foo
def bar(x, y)
end
end
module Bogus
@psyho
psyho / notatki
Created Apr 10, 2013
Notatki z SCKRK #40 - Lean Coffee
View notatki
Tematy:
* sckrk workshops (4)
- warsztaty z security
* open data (4)
- jak uwalniać dane z miasta
* why we fail in tdd and what we do about it (7)
* ddd-krk (7)
- nowy meetup dla ludzi z DDD
* formuła spotkań (3)
- co poza reading club i lean coffee
@psyho
psyho / Gemfile
Created Nov 2, 2012
Typhoeus 0.4.2 Memory Leak
View Gemfile
source :rubygems
# no leak in version 0.3.3
# gem 'typhoeus', '0.3.3'
# memory leaking very fast (1Mb/s) in version 0.4.2
gem 'typhoeus', '0.4.2'
@psyho
psyho / partials.html
Created Aug 24, 2011
caching partials in angular
View partials.html
<!doctype html>
<html xmlns:ng="http://angularjs.org">
<script src="http://code.angularjs.org/angular-0.9.19.min.js" ng:autobind></script>
<script type="text/javascript">
// this is the service generated by partials.rb
angular.service('partials', function() {
return {
'/foo': 'Foo template',
'/bar': 'Bar template'
@psyho
psyho / index.html
Created Aug 3, 2011
inline edit and dirty detection
View index.html
<!DOCTYPE HTML>
<html xmlns:ng="http://angularjs.org">
<head>
<title>Inline Edit</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js" type="text/javascript"></script>
<script src="http://code.angularjs.org/0.9.18/angular-0.9.18.min.js" type="text/javascript" ng:autobind></script>
<style type="text/css">
.dirty {
You can’t perform that action at this time.