Skip to content

Instantly share code, notes, and snippets.

View nglx's full-sized avatar
✌️
no mud no lotus

marcin naglik nglx

✌️
no mud no lotus
View GitHub Profile

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.

@nglx
nglx / finished_books.md
Last active July 3, 2019 09:42
Books I've read
  • 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

@nglx
nglx / codeship.log
Last active March 31, 2016 12:57
bundle exec rake jasmine:ci
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
@nglx
nglx / rom_yesql_with_sequel_rails.rb
Last active August 29, 2015 14:18
Reusing sequel-rails connection in rom-yesql
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
@nglx
nglx / rubycheck_1.rb
Last active August 29, 2015 14:11 — forked from anonymous/rubycheck_1
foo = :bar if false
foo.nil? # => raises an error because...?
@nglx
nglx / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/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,
]
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
@nglx
nglx / has_scope.rb
Last active December 24, 2015 20:38
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