start new:
tmux
start new with session name:
tmux new -s myname
| # Ruby CircleCI 2.0 configuration file | |
| # | |
| # Check https://circleci.com/docs/2.0/language-ruby/ for more details | |
| # | |
| defaults: &defaults | |
| working_directory: ~/repo | |
| docker: | |
| - image: circleci/ruby:2.4.1-node-browsers | |
| environment: |
| # See issue: https://github.com/palkan/action_policy/issues/15 | |
| module ActionPolicy | |
| module I18n | |
| class << self | |
| def full_message(policy_class, rule) | |
| # generate candidates | |
| candidates = [:"#{policy_class.identifier}.#{rule}"] | |
| # add global fallbacks |
| export default class ApiClient { | |
| constructor(params = {}) { | |
| this.baseURL = params.baseURl || ''; | |
| this.defaultData = params.defaultData || {}; | |
| this.defaultData.locale = params.locale || this.defaultLocale; | |
| } | |
| request(method, url, data = {}) { | |
| const requestData = this.createRequestData(data, method); | |
| return $.ajax(this.createRequestObject(method, url, requestData)); |
| def nearest_business_day_of_week_after(day_number) | |
| closest_monday = Date.current.monday | |
| days_diff = day_number - closest_monday.day | |
| jump_weeks = (days_diff.to_f / 7).ceil | |
| closest_monday + jump_weeks.weeks | |
| end |
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| export function method(type) { | |
| return function (target, key, descriptor) { | |
| const originalMethod = descriptor.value; | |
| descriptor.value = function (...args) { | |
| return originalMethod.call(this, ...args) | |
| }; | |
| return descriptor; | |
| } | |
| } |
| # base implementation of service object pattern | |
| class Service | |
| def self.call(*params) | |
| new(*params).call | |
| end | |
| class ServiceResponse | |
| def error? | |
| !success? | |
| end |
| # By default the behavior is: | |
| # Primary monitor work as always and second monitor only have one and fixed workspace | |
| # I.e. you change to next workspace, primary monitor change to this workspace and second monitor remain as is. | |
| # The desired behaviour is: | |
| # Primary monitor and secondary monitor are linked workspace. | |
| # I.e. you change to next workspace, primary monitor change to this workspace and second monitor too. | |
| $ gconf-editor | |
| # Look for /desktop/gnome/shell/windows/workspaces_only_on_primary and set to false |
| class CollectionPresenter | |
| include Enumerable | |
| def self.present(presenter_class) | |
| instance_variable_set(:@presenter_class, presenter_class) | |
| end | |
| def initialize(collection) | |
| presenter_class = extract_presenter_class | |
| @collection = collection.map do |object| |