This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //based on answer from http://stackoverflow.com/questions/18151679/how-to-programmatically-access-an-eclipse-jdt-tooltip-icon | |
| import org.eclipse.jdt.internal.ui.JavaPluginImages; | |
| def image = JavaPluginImages.get(JavaPluginImages.IMG_OBJS_QUICK_ASSIST) | |
| def newView = eclipse.views.create("a button with an image"); | |
| def button = newView.add_Button().setImage(image); | |
| return button; | |
| return "ok"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.eclipse.core.resources.*; | |
| import org.eclipse.ui.texteditor.*; | |
| def root = eclipse.workspace.root | |
| Map attribs = new HashMap(); | |
| attribs.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR)); | |
| attribs.put(IMarker.MESSAGE, "this is a test "); | |
| attribs.put("bogus field", "some text"); | |
| MarkerUtilities.createMarker(root, attribs, IMarker.PROBLEM); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def view = eclipse.views.create("Images Embeded in Eclipse"); | |
| view.clear().set.layout.grid(2); | |
| view.add.label("Hovered image:"); | |
| def text = view.add.text().set.layout.grid_Grab_Horizontal() | |
| def panel = view.add.panel() | |
| .set.layout.row() | |
| .set.layout.grid_Grab_All(2,1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| New Guidance Item | |
| Assign Information Security Responsibilities | |
| Avoid Accepting Delegates From Untrusted Sources | |
| Avoid Exposing Unmanaged Types Or Handles to Partially Trusted Code | |
| Avoid Storing Secrets in Code | |
| Avoid Using APTCA | |
| Back Up And Analyze Log Data Regularly | |
| Back Up And Analyze Log Files Regularly | |
| Calculate Destinations of Redirects And Forwards Without User Input | |
| Calculate Destinations of Redirects And Forwards Without User Input |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tempFolder = "_articlesMatches".tempDir(false); | |
| var targetZip = tempFolder + "_All.zip"; | |
| try | |
| { | |
| var fastZip = new ICSharpCode.SharpZipLib.Zip.FastZip(); | |
| fastZip.CreateEmptyDirectories = true; | |
| fastZip.CreateZip(targetZip, tempFolder, true, ""); | |
| return targetZip.fileExists(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var titlesData = "https://gist.github.com/DinisCruz/8653339/raw/ce19914729bc232fdbfae2348803abeceb0b4ec8/gistfile1.txt"; | |
| var email_ToFrom = "dcruz@securityinnovation.com"; | |
| var email_Subject = "TM Articles analysis"; | |
| var email_Body = "Please see the attached zip for the current analysis based on of titles from {0}".format(titlesData); | |
| var tmDatabase = TM_Xml_Database.Current; | |
| var secretData = tmDatabase.UserData.SecretData; | |
| var articles = tmDatabase.Cached_GuidanceItems.Values; | |
| var articlePaths = tmDatabase.GuidanceItems_FileMappings; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (TMEvents.OnApplication_BeginRequest.size() > 1) | |
| TMEvents.OnApplication_BeginRequest.remove(1); | |
| TMEvents.OnApplication_BeginRequest.Add( | |
| ()=>{ | |
| if(HttpContextFactory.Request.Url.str().contains(".js",".ashx",".asmx","jpg",".gif").isFalse()) | |
| { | |
| HttpContextFactory.Response.Write("<h1>Custom code 123</h1>"); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open_Article('Cross-Site Scripting'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var titlesData = "https://gist.github.com/DinisCruz/8653339/raw/04bac08187051090c239bf20866dc20d95752d6d/gistfile1.txt"; | |
| var tmDatabase = TM_Xml_Database.Current; | |
| var articles = tmDatabase.Cached_GuidanceItems.Values; | |
| var articlePaths = tmDatabase.GuidanceItems_FileMappings; | |
| var libraryName = ".NET 3.5"; | |
| var libraryId = tmDatabase.tmLibrary(libraryName).Id; | |
| var titles = "titles".o2Cache<List<String>>(()=>titlesData.GET().split("\n")) |