Skip to content

Instantly share code, notes, and snippets.

View workgena's full-sized avatar

Hennadii M. workgena

  • Amsterdam, The Netherlands
View GitHub Profile
@obenjiro
obenjiro / tracemeplz.md
Created April 17, 2021 05:18
Tracing.. what?

COMING SOON...

@ntamvl
ntamvl / create-ruby-gem-that-adds-rake-tasks.md
Last active February 16, 2024 19:13
How to create a Ruby gem that adds Rake tasks

How to create a Ruby gem that adds Rake tasks

Create a gem

One way to do this is to use bundler to scaffold our gem:

bundler gem my_gem

Add rake tasks to our gem

I prefer to put tasks meant to manage the gem itself in lib/tasks, and tasks the gem is meant to provide to gem users in lib/my_gem/tasks.

@timheilman
timheilman / rubocop_pre_commit_hook
Last active April 20, 2021 07:25
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified. Itself passes rubocop with default settings.
#!/usr/bin/env ruby
require 'rubocop'
require 'english'
ADDED_OR_MODIFIED = /A|AM|^M/
# to prevent code injection: system is a dangerous call
def raise_single_quote_error
raise ArgumentError, 'Single quotes are not allowed in filenames here.'
@willtonkin
willtonkin / ps4.cfg
Created June 28, 2016 10:53
PS4 Controller config for Quake 1
joyyawsensitivity "-1.0"
joypitchsensitivity "1.0"
joysidesensitivity "1.0"
joyforwardsensitivity "-1.0"
joyyawthreshold "0.15"
joypitchthreshold "0.15"
joysidethreshold "0.15"
joyforwardthreshold "0.15"
joyadvaxisv "4"
joyadvaxisu "0"
@andyjbas
andyjbas / gist:9962218
Last active June 23, 2020 13:33
Disable CSS Animations in Poltergeist & Phantomjs. Phantomjs does not like to wait for animations, and you can run in to nasty test flickers because of it. This pattern will disable animations in test env, and not touch any app code.
# env.rb or spec_helper.rb

Capybara.register_driver :poltergeist do |app|
  opts = {
    extensions: ["#{Rails.root}/features/support/phantomjs/disable_animations.js"] # or wherever
  }

  Capybara::Poltergeist::Driver.new(app, opts)
end
@rxaviers
rxaviers / gist:7360908
Last active May 7, 2024 16:34
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: