Skip to content

Instantly share code, notes, and snippets.

View cintrzyk's full-sized avatar

Marcin Brzeziński cintrzyk

  • stackin.com
  • Olsztyn
View GitHub Profile
@cintrzyk
cintrzyk / nazwa.txt
Created October 28, 2015 17:22
the description for this gist
yay file contents
@cintrzyk
cintrzyk / nazwa.txt
Created October 28, 2015 17:26
test_code_snippet
class Item
class Ng.RailsViews.AdminBlogImagesNewView extends Backbone.View
FILE_TYPES: ['image/png', 'image/jpeg', 'image/gif']
IMAGE_WIDTH = 100
el: 'body'
events:
'dragenter #blog-images .drop': 'dragEnter'
'dragover #blog-images .drop': 'dragOver'
@cintrzyk
cintrzyk / test_code_snippet.ruby
Created October 28, 2015 17:29
test_code_snippet
class Item
class Ng.RailsViews.AdminBlogImagesNewView extends Backbone.View
FILE_TYPES: ['image/png', 'image/jpeg', 'image/gif']
IMAGE_WIDTH = 100
el: 'body'
events:
'dragenter #blog-images .drop': 'dragEnter'
'dragover #blog-images .drop': 'dragOver'
@cintrzyk
cintrzyk / fibonacci7.ruby
Created October 28, 2015 17:30
fibonacci7 ruby
gcd(*neighbour(n, m))
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
require 'benchmark'
class Measurement
LEAN_BODY_MASS_PARAM = 0.01 # dummy value
attr_reader :weight
def lean_body_mass
weight * LEAN_BODY_MASS_PARAM unless weight.nil? # returns nil when no weight
end
require 'dry/monads'
require 'dry/matcher/result_matcher'
module BaseTransaction
include Dry::Monads[:result, :try, :do]
include Dry::Matcher.for(:call, with: Dry::Matcher::ResultMatcher)
def call
run
end