How to ignore_user_agent in Airbrake 5? - airbrake

We are migrating to Airbrake 5 and I'm wondering how to replace the functionality of the ignore_user_agent configuration. I know we have to check in an add_filter block, but not sure what/where to check?
Does anyone have an example of replacing the ignore_user_agent configuration option in Airbrake 5?

That would be easy (assuming this fix is merged in and the new gem is published):
Airbrake.add_filter do |notice|
notice.ignore! if notice[:context][:userAgent].match(/curl/)
end
In the meantime, you can use the class add_filter API.
From: https://github.com/airbrake/airbrake-ruby/issues/9
EDIT: the new gem was published.

Related

Determine Chrome Platform Version

Is there someway to determine the Chrome platform version in order to verify that I can use APIs that are marked v37 and later? If there is an alternative way of verifying that these new parameters are supported by the current install that works as well. My current solution is to check for the existence of a different v37 API which seems to be working, however if there is a sanctioned way that would make me feel a bit better about the whole thing :).
I need to use the 'scopes' portion of this API:
chrome.identity.getAuthToken.
In its Cog Chrome App, François Beaufort is using userAgent with a regex to get the chrome version:
window.alert(
navigator.userAgent.match('Chrome/([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)')[1]
);
But there is maybe a better way to check if some html/js API are available or not...
Try adding a minimum version to your manifest, so you don't even have to check in your code. This will prevent the app from webstore installs who are on older versions.
"minimum_chrome_version": "37",

cocos2d-x zlib support is missing crypt.c

I just noticed that the zlib_support in cocos2d-x is missing crypt.c
I was able to update the code and add crypt.h from
http://programming-practice.googlecode.com/svn/trunk/LevelUp/cocos2d-x/cocos2d-1.0.1-x-0.11.0/cocos2dx/platform/third_party/marmalade/zlib/contrib/minizip/crypt.h
to the project to get it working but I would like to know why this functionality is removed from the framework in the first place? Is there an alternative to the crypt.h I have used?
I finally found out the reason.
When you go on to publish your app, you are required to disclose if you are using encryption or not. And if your answer is yes, then there are separate and significantly longer process of approval. Adding encryption into cocos2d-x would therefore result in long approval times for a large number of apps. Hence it's not included.
http://cheminf20.org/2011/08/29/releasing-an-ios-app-using-encryption-first-time/

Is it possible to disable/override a ScriptResourceMapping requirement?

I upgraded a WebForms project to .net 4.5, and received this error:
WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping
for 'jquery'. Please add a ScriptResourceMapping named
jquery(case-sensitive).
I'd like to enable UnobtrusiveValidation, but I'm using Combres for Javascript resources, so I don't want the ScriptManager to try to download it again. Is it possible to tell the ScriptManager to just trust me that it will be loaded? In other words, I want to add a mapping for "jquery" that does nothing. It's apparently not possible to add a ScriptResourceDefinition with a name but no paths. Is there any other way?
As far as I can tell the answer is no.
This question has been asked on http://connect.microsoft.com/VisualStudio/feedback/details/735928/in-asp-net-web-application-visual-basic-the-requiredfieldvalidator-doest-work and on http://forums.asp.net/t/1850831.aspx/1 with no answers.
As a quick and nasty workaround to this problem I have added an empty file called DummyJQuery.js into the solution put the code below into application_start:
Dim jQuery As New ScriptResourceDefinition()
jQuery.Path = "~/js/DummyJQuery.js"
jQuery.DebugPath = "~/js/DummyJQuery.js"
ScriptManager.ScriptResourceMapping.AddDefinition("jquery", jQuery)
Answer described here: http://www.codeproject.com/Articles/465613/WebForms-UnobtrusiveValidationMode-requires-a

Creating Build Configuration via REST in Teamcity

Is it possible to create a new build configuration for an existing project via REST api(POST method) in Teamcity?
If so, how to create? (some guidelines )
Thanks
It's for sure possible on 8.x, haven't the need to care about early versions.
Here's a really simple python snippet that will copy an existing build config into a given project using this as a guide http://confluence.jetbrains.com/display/TCD8/REST+API#RESTAPI-BuildConfigurationAndTemplateSettings.
import requests
xml = """<newBuildTypeDescription name='NewBuildConfigName'
sourceBuildTypeLocator='ExistingBuildConfigNameThatYouWantToCopy'
copyAllAssociatedSettings='true' shareVCSRoots='false'/>
"""
headers = {'Content-Type': 'application/xml'} # set what your server accepts
print requests.post('http://YOURTEAMCITYWEBADDRESS:YOURTEAMCITYPORT/httpAuth/app/rest/projects/id:PROJECTIDWHERENEWBUILDCONFIGSHOULDBECREATED/buildTypes', data=xml, headers=headers, auth=('TeamCityUserName','TeamCityPassword')).text
Its now possible in 8.x REST. You can do something like:
POST plain text (name) to http://teamcity:8111/httpAuth/app/rest/projects/<projectLocator>/buildTypes
Above is copied from 8.x REST. Check 8.x REST for more details.
No, it's not implemented in the REST API. Have a look at this
There is no way to create a build configuration. You can add build steps to it and configure them, but it doesn't seem to be implemented in the API at all. I was actually fighting with this myself last night. If you find a way to do it, please let me know.
Also, you could have a look at these notes I've put together concerning the Teamcity REST API. (Not that they're answering this question, but some of them could be quite useful).
Well, you can refer to this for starters:

How to use omnigroup framework in an iOS project?

I need to be able to write and read from a rtf file in iOS.
The omnigroup framework has the 2 classes i am looking for :
OmniUI/iPad/RTF/OUIRTFReader
OmniUI/iPad/RTF/OUIRTFWriter
I managed to build the frameworks but i cant figure out how to integrate theses classes in my own project.
I had the following frameworks to my project :
OmniAppKit.framework
OmniFoundation.framework
OmniBase.framework
I still get some undefined identifier such as :
RCS_ID("$Id$");
OBINITIALIZE
OMNI_POOL_START
Has anybody been able to use the omnigroup framework in your own project ?
Thanks,
Vincent
We do need some better documentation for this, but the TextEditor example app in OmniUI/iPad/Examples/TextEditor may be a good starting point for seeing how we include the frameworks in our apps.
In this particular case, you may prefer to pull out the OUIRTFReader class and any dependencies it needs from OmniAppKit and OmniFoundation into your project. updating the #imports to be "..." instead of <OmniThis/AndOmniThat.h>.
Perhaps you could try following the instructions given as part of this thread on the Omni Group forums. They appear to have been able to build the framework under the iOS 4.2 SDK.
I don't think you want the OmniAppKit framework, as that is just for the Mac.