I hereby claim:
- I am unixmonkey on github.
- I am unixmonkey (https://keybase.io/unixmonkey) on keybase.
- I have a public key whose fingerprint is 4410 F05C 0581 480F 39BB 6636 8DBB 5317 AFCF B014
To claim this, I am signing this object:
# Override Deprecation warnings to only show each unique deprecation message | |
# once instead of repeating it every time the deprecated code is run. | |
# This can help prevent the "wall of deprecations" when one commonly-called | |
# action produces a deprecation over and over again. | |
# | |
# You can also add regular expressions to the `@@ignored` array to silence them. | |
# | |
if Rails.env.test? | |
module ActiveSupport | |
class Deprecation |
def remove_validator!(validator_class, model_class, field) | |
model_class.class_eval do | |
_validators[field].reject! { |v| v.class == validator_class } | |
cb = _validate_callbacks.detect { |c| c.raw_filter.class == validator_class } | |
_validate_callbacks.delete(cb) if cb | |
end | |
end |
#!/usr/bin/env ruby | |
require 'pathname' | |
# path to your application root. | |
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) | |
Dir.chdir APP_ROOT do | |
# This script is a starting point to setup your application. | |
# Add necessary setup steps to this file: |
# Wrap some code with this block to change the browser window size | |
# When the block exits, it will resize to its original dimensions | |
# with_browser_size(1024, 768) { find('.hidden-sm').click } | |
def with_browser_size(width, height, &block) | |
window = Capybara.current_session.driver.browser.manage.window | |
before_size = window.size | |
window.resize_to(width, height) | |
yield | |
window.resize_to(before_size[:width], before_size[:height]) | |
end |
# Fun stuff for training purposes | |
# Demonstrates: | |
# Monkey-Patching | |
# Polymorphism | |
# Case statements | |
# Type matching | |
# Regular Expressions | |
# Raising errors | |
# Enumurable#map | |
# Symbol to Proc |
(function(){ | |
'use strict'; | |
/* | |
* A module for adding new a routing system Angular 1. | |
*/ | |
angular.module('ngComponentRouter', []) | |
.directive('ngOutlet', ngOutletDirective) | |
.directive('ngOutlet', ngOutletFillContentDirective) | |
.directive('ngLink', ngLinkDirective); |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
# This pre-commit hook aims to prevent you from *accidentally* committing debugger | |
# statements if installed in your project. You can force a commit if necessary with: | |
# `git commit --no-verify`. | |
# Install by copying it to <your-project-dir>/.git/hooks/pre-commit' | |
hits = [] | |
rb_debuggers = ['binding\.pry', 'binding\.remote_pry', 'debugger', 'focus: true', ':focus => true', 'save_and_open_page', 'save_and_open_screenshot'] | |
js_debuggers = ['console\.log', 'debugger'] |
/* | |
* Copyright (c) 2007-2014 by Apple Inc.. All rights reserved. | |
* | |
* @APPLE_LICENSE_HEADER_START@ | |
* | |
* This file contains Original Code and/or Modifications of Original Code | |
* as defined in and that are subject to the Apple Public Source License | |
* Version 2.0 (the 'License'). You may not use this file except in | |
* compliance with the License. Please obtain a copy of the License at | |
* http://www.opensource.apple.com/apsl/ and read it before using this |
--- ./qt-everywhere-opensource-src-4.8.6/src/gui/kernel/qcocoaapplicationdelegate_mac.mm 2014-06-12 10:20:38.000000000 +0300 | |
+++ ./qt-everywhere-opensource-src-4.8.6/src/gui/kernel/qcocoaapplicationdelegate_mac.mm 2014-06-12 21:59:18.000000000 +0300 | |
@@ -122,7 +122,7 @@ | |
[dockMenu release]; | |
[qtMenuLoader release]; | |
if (reflectionDelegate) { | |
- [NSApp setDelegate:reflectionDelegate]; | |
+ [[NSApplication sharedApplication] setDelegate:reflectionDelegate]; | |
[reflectionDelegate release]; | |
} |