Skip to content

Instantly share code, notes, and snippets.

Posăceanu Marian marianposaceanu

Block or report user

Report or block marianposaceanu

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

Keybase proof

I hereby claim:

  • I am marianposaceanu on github.
  • I am dakull (https://keybase.io/dakull) on keybase.
  • I have a public key ASAh1wAzfMC9-2TW-ZwfKJU7fwtpkS-Yh17tNzAjpAWtHgo

To claim this, I am signing this object:

View measure_features_run_time.rb
require 'benchmark'
timings = {}
measure_feature = -> feature_path {
time = Benchmark.measure {
puts "Benchmarking feature #{feature_path}."
cmd = `cucumber --format json -r features '#{feature_path}'`
}
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@marianposaceanu
marianposaceanu / octopus.rest.md
Last active Jun 10, 2016
octopus.rest - state of the art REST client
@marianposaceanu
marianposaceanu / mkvit.rb
Last active May 19, 2016
Convert videos to H.264 mkv easily (using ffmpeg)
View mkvit.rb
# _ _ _
# | | (_)| |
# _ __ ___ | | ____ __ ______ _ | |_
# | '_ ` _ \ | |/ /\ \ / /|______|| || __|
# | | | | | || < \ V / | || |_
# |_| |_| |_||_|\_\ \_/ |_| \__|
#
# Simple script to convert your old video files to H.264 mantaining their quality
#
# Usage:
@marianposaceanu
marianposaceanu / branching.md
Last active Apr 14, 2016
Git: naming branches
View branching.md

Examples

I'm working on a feature in ticket 59:

git co -b feature/59/add-filtering

I'm working on a bug:

git co -b bug/101/template-error

View neat_ruby_debug.rb
# The classics
class Foo
def bar; end
def self.baz; end
end
Foo.instance_method(:bar).source_location
Foo.method(:baz).source_location
# A tad more
@marianposaceanu
marianposaceanu / ElCapitan.applescript
Created Feb 17, 2016 — forked from nrollr/ElCapitan.applescript
Performance improvements for El Capitan
View ElCapitan.applescript
-- Disable Time Machine Local Backups
sudo tmutil disablelocal
-- Disable Automatic Spell Checker
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false
-- Disable animations when opening and closing windows.
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
-- Disable animations when opening a Quick Look window.
defaults write -g QLPanelAnimationDuration -float 0
-- Accelerated playback when adjusting the window size (Cocoa applications).
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
View half_half.rb
run_with_tco = ARGV.include?('-TCO')
# Force the ruby interpreter to use TCO
RubyVM::InstructionSequence.compile_option = {
tailcall_optimization: true,
trace_instruction: false
} if run_with_tco
puts 'To infinity and beyond!' if run_with_tco
You can’t perform that action at this time.