Skip to content

Instantly share code, notes, and snippets.

:octocat:
ror

Marcin Naglik managr

:octocat:
ror
Block or report user

Report or block managr

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 unshakable_freedom.md

Unshakable Freedom: Ancient Stoic Secrets Applied to Modern Life

  • Don’t you know that freedom is a glorious thing of great worth?   EPICTETUS

  • If you choose, you are free; if you choose, you need to blame no one and accuse no one                                                                                      Epictetus[5]

  • You can only control what is under your control.

  • What is not in your control is neither good nor bad.

@managr
managr / finished_books.md
Last active Jul 3, 2019
Books I've read
View finished_books.md
  • Upadek / Albert Camus / 16.08.2018

  • Principles / Ray Dalio / 22.08.2018

  • Tao Te Ching / Lao-Tzu by Stephen Mitchell / 07.09.2018

  • Każdy krok niesie pokój / Thich Nhat Hanh / 14.09.2018

  • Turn the ship around / L. David Marquet

  • Unshakable Freedom: Ancient Stoic Secrets Applied to Modern Life / Chuck Chakrapani / 02.07.2019

View js_lessons.md
@managr
managr / codeship.log
Last active Mar 31, 2016
bundle exec rake jasmine:ci
View codeship.log
Waiting for jasmine server on 55287...
jasmine server started.
Phantomjs does not appear to be installed in /home/rof/.phantomjs/1.9.8/x86_64-linux/bin/phantomjs, installing!
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 321 0 0 9269 0 --:--:-- --:--:-- --:--:-- 9269
bunzip2: phantomjs-1.9.8-linux-x86_64.tar.bz2 is not a bzip2 file.
tar: phantomjs-1.9.8-linux-x86_64.tar: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
@managr
managr / rom_yesql_with_sequel_rails.rb
Last active Aug 29, 2015
Reusing sequel-rails connection in rom-yesql
View rom_yesql_with_sequel_rails.rb
ROM::Yesql::Repository.class_eval do
def initialize(uri, options = {})
super
@connection = Sequel::Model.db
initialize_queries
ROM::Yesql::Relation.query_proc(query_proc)
ROM::Yesql::Relation.load_queries(queries)
end
end
View rubycheck_1.rb
foo = :bar if false
foo.nil? # => raises an error because...?
@managr
managr / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View benchmark.rb
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]
View form_object.rb
class UsersController < ApplicationController
def index
user_search = UserSearch.new(params[:user_search])
@users = User.by_user_search(user_search)
end
end
# user search form object
class UserSearch
include Virtus.model
View has_scope.rb
class UsersController < ApplicationController
include User::SearchScope
def index
search_params = params[:user_search] || {}
@users = apply_scopes(User, search_params)
end
end
class User < ActiveRecord::Base
You can’t perform that action at this time.